Skip to content

fix(ci): pin gitleaks and retry the download - #8

Merged
h4x0r merged 1 commit into
mainfrom
fix/pin-and-retry-gitleaks
Aug 20, 2026
Merged

fix(ci): pin gitleaks and retry the download#8
h4x0r merged 1 commit into
mainfrom
fix/pin-and-retry-gitleaks

Conversation

@h4x0r

@h4x0r h4x0r commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

fix(ci): pin gitleaks and retry the download

Two defects in one step. The version came from an unauthenticated
releases/latest API call, which rate-limits on shared runners; when it does,
VERSION is empty, the download 404s, and | tar xz swallows it -- so the secret
scan can run against a gitleaks that was never installed. fleet-ci hit exactly
this and pinned the version with a comment saying so; this repo predates that
and still asks the API.

Now pinned to 8.30.1 with a # renovate: marker so it is bumped deliberately
rather than drifting, and the tarball is written to disk before tar reads it,
so a failed fetch cannot be piped into an extractor that shrugs.

The fetch itself is retried three times with 15s/30s backoff and a 120s cap per
attempt, then fails naming the endpoint rather than the code.

Verified against a stubbed curl: succeeds first try; succeeds after two
failures; and on permanent failure exits 1 after exactly three attempts with two
warnings and one error, rather than hanging or passing.

Two defects in one step. The version came from an unauthenticated
`releases/latest` API call, which rate-limits on shared runners; when it does,
VERSION is empty, the download 404s, and `| tar xz` swallows it -- so the secret
scan can run against a gitleaks that was never installed. fleet-ci hit exactly
this and pinned the version with a comment saying so; this repo predates that
and still asks the API.

Now pinned to 8.30.1 with a `# renovate:` marker so it is bumped deliberately
rather than drifting, and the tarball is written to disk before `tar` reads it,
so a failed fetch cannot be piped into an extractor that shrugs.

The fetch itself is retried three times with 15s/30s backoff and a 120s cap per
attempt, then fails naming the endpoint rather than the code.

Verified against a stubbed curl: succeeds first try; succeeds after two
failures; and on permanent failure exits 1 after exactly three attempts with two
warnings and one error, rather than hanging or passing.
@h4x0r
h4x0r merged commit 99c36c3 into main Aug 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant