Tool information
tldr sha256sum
Calculate SHA256 cryptographic checksums.
- Calculate the SHA256 checksum for a file:
sha256sum filename1
- Calculate SHA256 checksums for multiple files:
sha256sum filename1 filename2
- Read a file of SHA256 sums and verify all files have matching checksums:
sha256sum -c filename.sha256
Virtual environments affected
Can this tool be installed during the build?
It could be installed, but my understanding is that this is normally a standard unix tool.
Are you willing to submit a PR?
Possibly! Unclear where this is maintained but can happily take a look if someone could point me in the right direction.
Example use case: https://github.com/uber/AutoDispose/pull/403
Workaround suggested by @imbsky on the example case above is to brew install coreutils first. It does add ~12sec to our build time, so it's not ideal but it is a doable workaround.
- name: Install coreutils for macOS
run: brew install coreutils
or
- name: Install coreutils for macOS
if: matrix.os == 'macOS-latest'
run: brew install coreutils
@ZacSweers question: Why can't you use macOS' default tool for this? I.e.,
shasum -a 256 foo.txt > foo-sha256.txt
shasum -c foo-sha256.txt
I admit it is annoying to have to condition your calls to the checksum program by OS, but there is a native tool that ships with the OS (or at least with Xcode) that will do this.
Didn鈥檛 know about it!
@ZacSweers If this is a suitable work around for you, I would recommend closing this issue to help the GHA team focus on the most pertinent tasks. But if you still want/need sha256sum then keep it open.
Most helpful comment
Workaround suggested by @imbsky on the example case above is to
brew install coreutilsfirst. It does add ~12sec to our build time, so it's not ideal but it is a doable workaround.or