Skip to content

Commit

Permalink
Fix key hash on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jun 16, 2024
1 parent 652f74a commit 58e3d28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scripts/cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ data() {
dir='C:\\tools\\php\\ext'
fi
job="${GITHUB_REPOSITORY}-${GITHUB_WORKFLOW}-${GITHUB_JOB}"
key="$(echo -n "$extensions-$key-$job" | sha256sum | cut -d ' ' -f 1)"
if command -v "sha256sum" >/dev/null; then
key="$(echo -n "$extensions-$key-$job" | sha256sum | cut -d ' ' -f 1)"
else
key="$(echo -n "$extensions-$key-$job" | openssl dgst -sha256 | cut -d ' ' -f 2)"
fi
key="$os"-"$version"-"$key"-"$date"
echo "$dir" > "${RUNNER_TEMP:?}"/dir
echo "$key" > "${RUNNER_TEMP:?}"/key
Expand Down

0 comments on commit 58e3d28

Please sign in to comment.