fix(github action): don't die on rate-limited version lookup#37512
Closed
sfmullen wants to merge 1 commit into
Closed
fix(github action): don't die on rate-limited version lookup#37512sfmullen wants to merge 1 commit into
sfmullen wants to merge 1 commit into
Conversation
Composite bash steps run with -e -o pipefail, so a failed
unauthenticated curl to api.github.com (shared runner IPs regularly
exhaust the 60/hr limit) kills the step before the ${VERSION:-latest}
fallback on the next line can apply. Authenticate the lookup with
github.token and let the pipeline fail soft so the documented fallback
is actually reachable.
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
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.
Problem
The GitHub action's version step:
shell: bashcomposite steps run with-e -o pipefail, so when the unauthenticated curl is rate-limited (GitHub-hosted runners share IP pools against the 60 req/hr unauthenticated API limit, so this happens regularly), the failed command substitution kills the step and the${VERSION:-latest}fallback on the next line is unreachable. The consumer's whole job fails at setup. We hit this intermittently in CI: the action step exits 1 about 23s in, and a plain re-run goes green.Fix
Two small changes to the version step, nothing caller-facing:
github.token(always available inside composite actions; a public-repo read needs no scopes). This removes the rate-limit cause.|| trueon the substitution so the documented${VERSION:-latest}fallback is actually reachable if the lookup still fails for any other reason (e.g. a token that is not valid for api.github.com on GHES runners).Worst case becomes what the code already intended: fall back to
latestand let the install script resolve the version.