Skip to content

Commit 5e274d9

Browse files
Fix macos hashing for O/s and availability of md5sum (#34398)
Co-authored-by: Andrei Litvin <andreilitvin@google.com>
1 parent 4ec643c commit 5e274d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/actions/bootstrap/action.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ runs:
2626
# because the bootstrapped Pigweed environment contains absolute paths.
2727
echo "Calculating bootstrap cache key for '$PWD'"
2828
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
29-
OS_HASH="$(md5sum /etc/lsb-release | cut -d' ' -f1)"
30-
PYTHON_HASH="$(python --version | md5sum | cut -d' ' -f1)"
29+
case "$RUNNER_OS" in
30+
macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";;
31+
*) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";;
32+
esac
33+
PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)"
3134
FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)"
3235
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
3336

0 commit comments

Comments
 (0)