Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugging info in golden hash file #873

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/actions/sha-of-zip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ powershell -Command "& {[IO.File]::WriteAllText(\"%HASHFILE_SORTED%\", $([IO.Fil
:: echo the final hash
C:\Windows\System32\certutil.exe -hashfile %HASHFILE_SORTED% SHA%SHA_A% | findstr /v ":"

:: For debugging, enable printing the file-by-file hash
:: echo File-by-file hash
:: type "%HASHFILE_SORTED%"
:: For easier debugging, print the file-by-file hash
echo ##########
echo This checksum was created by a SHA-%SHA_A% of the following file, after removing the filenames and sorting by their SHAs:
yezr marked this conversation as resolved.
Show resolved Hide resolved
sort "%HASHFILE_SORTED%"

endlocal
8 changes: 8 additions & 0 deletions .github/actions/sha-of-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ parentPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
# Make a temporary directory to extract zip, and a temporary file to hold SHAs
tempDirectory=$(mktemp -d)
tempAllChecksumsFile=$(mktemp)
tempChecksumDebugInfoFile=$(mktemp)
touch $tempAllChecksumsFile
touch $tempChecksumDebugInfoFile

# Extract the zip
unzip -q $zipFilepath -d $tempDirectory 2>/dev/null
Expand All @@ -25,7 +27,13 @@ cd $tempDirectory
for filename in $(find * -type f | sort); do
checksum=$($parentPath/../workflows/sha.sh $filename $os $sha_a)
echo $checksum >> $tempAllChecksumsFile
echo $filename = $checksum >> $tempChecksumDebugInfoFile
done

# Echo the checksum of the checksums
echo $($parentPath/../workflows/sha.sh $tempAllChecksumsFile $os $sha_a)

# For easier debugging, print the file-by-file hash
echo "##########"
echo "This checksum was created by a SHA-$sha_a of the following file, after removing the filenames and sorting by their SHAs:"
cat $tempChecksumDebugInfoFile | sort
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
types: [ published ]
schedule:
- cron: '0 12 1,15 * *' # On the 1st and 15th of the month at noon
## To test this workflow without creating a release, uncomment the following and add a branch name (making sure "push"
## is at the same indent level as "release":
# push:
# branches:
# - 'branch-name'
# To test this workflow without creating a release, uncomment the following and add a branch name (making sure "push"
# is at the same indent level as "release":
push:
branches:
- 'feature/golden-hash-debugging'

jobs:
release:
Expand Down
Loading