Give buf-setup-action a token so setup stops hitting the rate limit - #4547
Merged
Conversation
buf-setup-action resolves the buf release download URL through the
GitHub API. The step passed no token, so that request went out
anonymous and drew on the per-IP limit shared with every other job on
the runner, which intermittently failed the job before buf ever ran:
Setting up buf version "1.50.0"
Resolving the download URL for the current platform...
##[error]API rate limit exceeded for 172.183.131.23.
The action warns about this itself — "No github_token supplied, API
requests will be subject to stricter rate limiting". Passing the
workflow's own token moves the request to the authenticated limit.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ANVHEs41RJbybS3ja9N1SA
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.
Summary
bufbuild/buf-setup-actionresolves the buf release download URL through the GitHub API. The step in.github/workflows/buf.ymlpassed no token, so that request went out anonymous and drew on the rate limit shared by every other job on the runner's IP. When the limit was already spent, the job failed during setup, before buf ever ran:The action warns about this itself in the same log —
No github_token supplied, API requests will be subject to stricter rate limiting. Passing the workflow's owngithub.tokenmoves the request to the authenticated limit, which is per-installation rather than per-IP.This was hit on #4544, where the
buf / buildcheck went red on a branch that touches no.protoor buf files. It's intermittent rather than constant: that was the only buf failure in the surrounding ten runs, and an earlier run on the same branch passed.github.tokenis the token GitHub already mints for the run, so there's no new secret to configure. It only needs read access to resolve a public release, which is within the defaultpull_requestpermissions — including for forks, where the token is read-only.Testing
Workflow changes only; nothing to exercise locally. Verified the file still parses and the step is well-formed:
The buf workflow runs on this PR, which exercises the changed step directly.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ANVHEs41RJbybS3ja9N1SA
Generated by Claude Code