fix(ci): pin gitleaks and retry the download - #8
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(ci): pin gitleaks and retry the download
Two defects in one step. The version came from an unauthenticated
releases/latestAPI call, which rate-limits on shared runners; when it does,VERSION is empty, the download 404s, and
| tar xzswallows it -- so the secretscan 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 deliberatelyrather than drifting, and the tarball is written to disk before
tarreads 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.