setup-avocado-cli: authenticate the release lookup and retry transients - #1
Open
mobileoverlord wants to merge 1 commit into
Open
setup-avocado-cli: authenticate the release lookup and retry transients#1mobileoverlord wants to merge 1 commit into
mobileoverlord wants to merge 1 commit into
Conversation
The `latest` release lookup hit api.github.com with no credentials, so it
was limited to 60 requests/hour/IP. The references repo runs ~35 jobs
concurrently, so jobs lose that race and fail before doing any work:
curl: (22) The requested URL returned error: 403
Sending github.token raises the limit to 1000/hour for the repo. Callers
need no change -- the token comes from the composite action's own context.
Also add --retry for the blips authentication does not help with (both the
API call and the asset download), and fail with a clear message when the
tag cannot be resolved instead of building the URL from a literal "null".
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.
What
setup-avocado-cliresolveslatestby callingapi.github.comwith no credentials:ver="$(curl -sSfL "https://api.github.com/repos/${repo}/releases/latest" | jq -r .tag_name)"Unauthenticated GitHub API is capped at 60 requests/hour per IP.
avocado-linux/referencesruns ~35 jobs concurrently, so jobs lose that race and die in the "Install avocado CLI" step before doing any work:Hit this on references#23: the
devreference failed this way while the other 34 jobs passed, having passed in the two preceding runs. It reads as a flaky reference, but nothing about the reference is involved — and with a matrix that size it will keep recurring.Fix
github.tokenon the API request, raising the limit to 1000/hour for the repo. Callers need no change — the token comes from the composite action's owngithubcontext. The header is only added when the token is non-empty, so a pinnedversion:still works with no token at all.--retry 3 --retry-all-errorson both the API call and the asset download, for the transient 5xx/connection blips auth does not fix.null.Verification
action.ymlparses; the embedded script passesbash -n. Checked the empty-array expansion underset -euo pipefailin both branches (token present and absent) — used the explicitifform rather than[ ... ] && ...so it does not depend onset -e's subtler AND-list semantics.Note
mainand thev1tag currently have identical content for this file, and every consumer pins@v1, sov1needs re-pointing after merge for this to take effect.