GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(workflows): retry nix-hashes compute-hash on transient failure (#… · msegeya/opencode@5c8eb0a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • nix-hashes.yml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/nix-hashes.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/nix-hashes.yml
+15-5Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,24 @@ jobs:
5656
BUILD_LOG=$(mktemp)
5757
trap 'rm -f "$BUILD_LOG"' EXIT
5858
59-
# Build with fakeHash to trigger hash mismatch and reveal correct hash
60-
nix build ".#packages.${SYSTEM}.node_modules_updater" --no-link 2>&1 | tee "$BUILD_LOG" || true
59+
HASH=""
60+
MAX_ATTEMPTS=3
61+
for ((ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++)); do
62+
# Build with fakeHash to trigger hash mismatch and reveal correct hash
63+
nix build ".#packages.${SYSTEM}.node_modules_updater" --no-link 2>&1 | tee "$BUILD_LOG" || true
6164
62-
# Extract hash from build log with portability
63-
HASH="$(nix run --inputs-from . nixpkgs#gnugrep -- -oP 'got:\s*\Ksha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | tail -n1 || true)"
65+
HASH="$(nix run --inputs-from . nixpkgs#gnugrep -- -oP 'got:\s*\Ksha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | tail -n1 || true)"
66+
67+
[ -n "$HASH" ] && break
68+
69+
if [ "$ATTEMPT" -lt "$MAX_ATTEMPTS" ]; then
70+
echo "::warning::Attempt ${ATTEMPT}/${MAX_ATTEMPTS} produced no hash for ${SYSTEM}; retrying in $((ATTEMPT * 10))s"
71+
sleep $((ATTEMPT * 10))
72+
fi
73+
done
6474
6575
if [ -z "$HASH" ]; then
66-
echo "::error::Failed to compute hash for ${SYSTEM}"
76+
echo "::error::Failed to compute hash for ${SYSTEM} after ${MAX_ATTEMPTS} attempts"
6777
cat "$BUILD_LOG"
6878
exit 1
6979
fi

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.