An open source design system that's fully customizable and agent ready
TypeScript
ci: actionlint's download retries a failed request (#10670)
Cindy Zhang5e5ee5f29e06
diff --git a/.github/scripts/ci-actionlint.test.mjs b/.github/scripts/ci-actionlint.test.mjsindex fcb6e8a6e6..10c2398514 100644--- a/.github/scripts/ci-actionlint.test.mjs+++ b/.github/scripts/ci-actionlint.test.mjs@@ -48,6 +48,20 @@ describe('Lint: actionlint on workflow changes', () => {);});+ it('retries a failed download, and checks the checksum before unpacking', () => {+ expect(step.run).toContain(+ 'curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 --max-time 60 -o "$archive"',+ );+ const lines = step.run.split('\n').map(line => line.trim());+ const at = text => lines.findIndex(line => line.startsWith(text));+ expect(+ at('echo "$ACTIONLINT_SHA256 $archive" | sha256sum -c -'),+ ).toBeGreaterThan(at('curl -fsSL'));+ expect(at('tar -xzf "$archive"')).toBeGreaterThan(+ at('echo "$ACTIONLINT_SHA256 $archive" | sha256sum -c -'),+ );+ });+it('pins actionlint by version and checksum for the arm64 runner', () => {expect(job['runs-on']).toBe('ubuntu-24.04-arm');expect(step.env.ACTIONLINT_VERSION).toMatch(/^\d+\.\d+\.\d+$/);diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex f70f0ff5d9..69e53b8901 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -144,7 +144,9 @@ jobs:ficommand -v shellcheck >/dev/null || { echo "::error::shellcheck is not installed."; exit 1; }archive="$RUNNER_TEMP/actionlint.tar.gz"- curl -fsSL -o "$archive" \+ # A release download can fail for a moment (a 504, say); retry it+ # rather than fail the job.+ curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 --max-time 60 -o "$archive" \"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_arm64.tar.gz"echo "$ACTIONLINT_SHA256 $archive" | sha256sum -c -tar -xzf "$archive" -C "$RUNNER_TEMP" actionlint