Skip to content

Commit f93c783

Browse files
Apply PR #11533: fix(ci): portable hash parsing in nix-hashes workflow
2 parents abbf600 + 9a122e2 commit f93c783

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

.github/workflows/nix-hashes.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ jobs:
5858
# Build with fakeHash to trigger hash mismatch and reveal correct hash
5959
nix build ".#packages.${SYSTEM}.node_modules_updater" --no-link 2>&1 | tee "$BUILD_LOG" || true
6060
61-
HASH="$(grep -E 'got:\s+sha256-' "$BUILD_LOG" | sed -E 's/.*got:\s+(sha256-[A-Za-z0-9+/=]+).*/\1/' | head -n1 || true)"
62-
if [ -z "$HASH" ]; then
63-
HASH="$(grep -A2 'hash mismatch' "$BUILD_LOG" | grep 'got:' | sed -E 's/.*got:\s+(sha256-[A-Za-z0-9+/=]+).*/\1/' | head -n1 || true)"
64-
fi
61+
# Extract hash from build log with portability
62+
HASH="$(grep -oE 'sha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | tail -n1 || true)"
6563
6664
if [ -z "$HASH" ]; then
6765
echo "::error::Failed to compute hash for ${SYSTEM}"

0 commit comments

Comments
 (0)