fix(ci): fall back to github.token for the PR label fetch on fork PRs - #66560
Closed
beardthelion wants to merge 1 commit into
Closed
fix(ci): fall back to github.token for the PR label fetch on fork PRs#66560beardthelion wants to merge 1 commit into
beardthelion wants to merge 1 commit into
Conversation
597615a moved the ci-review label fetch into a retry step that authenticates with secrets.AUTOFIX_BOT_PAT. Fork-origin pull_request runs cannot read repository secrets, so GH_TOKEN resolves empty there, gh exits before the label check runs, and the job fails for every fork PR regardless of content. Fall back to the built-in read-only token when the PAT is unavailable. The fetch only needs read access to PR labels, and the gate's decision still keys off labels only maintainers can set.
This was referenced Jul 17, 2026
Closed
Contributor
|
Thanks for this, @beardthelion — the fork label-fetch fix is exactly right. The We landed the same fallback on the label fetch (plus the |
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 does this PR do?
Restores CI for pull requests opened from forks. Since 597615a, the ci-review job's "Fetch PR labels" step authenticates with
secrets.AUTOFIX_BOT_PAT. Repository secrets are not available to fork-originpull_requestruns, so on every fork PR the token resolves empty,ghexits 1, the retry wrapper fails the job after three attempts, and the "All required checks pass" aggregate goes red regardless of the PR's content.This falls back to the built-in read-only token when the PAT is unavailable, which is enough for reading labels. Same-repo runs keep using the PAT, and the gate's decision still keys off the ci-reviewed label, which only maintainers can set, so fork PRs gain no new capability from the fallback.
Related Issue
Fixes #66559
Type of Change
Changes Made
.github/workflows/lint.yml: the "Fetch PR labels" step'sGH_TOKENnow falls back togithub.tokenwhensecrets.AUTOFIX_BOT_PATis unavailable (fork-origin runs).How to Test
gh pr view --json labelsneeds only read access, which that token has.Note: this PR itself edits a CI-sensitive file, so the ci-reviewed gate applies to it, and because it comes from a fork its own ci-review job will keep failing at the broken fetch step until the fix is on main. It needs a maintainer's ci-reviewed label and a merge over the red check.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -q: N/A, workflow-only change with no Python surfaceDocumentation & Housekeeping
cli-config.yaml.example: N/ACONTRIBUTING.mdorAGENTS.md: N/A