Skip to content

Commit

Permalink
Fix macos hashing for O/s and availability of md5sum (#34398)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Dec 5, 2024
1 parent 1b5afa6 commit 1233392
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/actions/bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ runs:
# because the bootstrapped Pigweed environment contains absolute paths.
echo "Calculating bootstrap cache key for '$PWD'"
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
OS_HASH="$(md5sum /etc/lsb-release | cut -d' ' -f1)"
PYTHON_HASH="$(python --version | md5sum | cut -d' ' -f1)"
case "$RUNNER_OS" in
macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";;
*) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";;
esac
PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)"
FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)"
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 1233392

Please sign in to comment.