Virtual-environments: Add sha256sum to macOS

Created on 12 Nov 2019  路  5Comments  路  Source: actions/virtual-environments

Tool information

  • Tool name: sha256sum
  • Add or update? Add
  • Desired version: Latest
  • Approximate size:
  • If this is an add request:

    • Brief description of tool:

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

  • [x] macOS 10.15
  • [] Ubuntu 16.04 LTS
  • [] Ubuntu 18.04 LTS
  • [] Windows Server 2016 R2
  • [] Windows Server 2019

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.

enhancement

Most helpful comment

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

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orj picture orj  路  4Comments

mxschmitt picture mxschmitt  路  3Comments

shivammathur picture shivammathur  路  3Comments

motss picture motss  路  3Comments

trajano picture trajano  路  3Comments