ci(windows): use sha256sum for cross-platform hash computation

This commit is contained in:
Karun Agarwal 2026-01-27 14:32:52 +05:30
parent eefdc3f3df
commit c1e6bf8ead
2 changed files with 15 additions and 8 deletions

View File

@ -272,9 +272,7 @@ jobs:
pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --frozen-lockfile --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
run: |
export PATH="/c/Program Files/Git/usr/bin:$PATH"
${{ matrix.command }}
run: ${{ matrix.command }}
checks-macos:
if: github.event_name == 'pull_request'

View File

@ -30,11 +30,20 @@ collect_files() {
}
compute_hash() {
collect_files \
| LC_ALL=C sort -z \
| xargs -0 shasum -a 256 \
| shasum -a 256 \
| awk '{print $1}'
# Use sha256sum (more portable on Windows) or fall back to shasum
if command -v sha256sum >/dev/null 2>&1; then
collect_files \
| LC_ALL=C sort -z \
| xargs -0 sha256sum \
| sha256sum \
| awk '{print $1}'
else
collect_files \
| LC_ALL=C sort -z \
| xargs -0 shasum -a 256 \
| shasum -a 256 \
| awk '{print $1}'
fi
}
current_hash="$(compute_hash)"