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 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 }}) - name: Run ${{ matrix.task }} (${{ matrix.runtime }})
run: | run: ${{ matrix.command }}
export PATH="/c/Program Files/Git/usr/bin:$PATH"
${{ matrix.command }}
checks-macos: checks-macos:
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'

View File

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