fix(ci): fall back to github.token when AUTOFIX_BOT_PAT empty on fork PRs - #66562
Closed
pnascimento9596 wants to merge 1 commit into
Closed
fix(ci): fall back to github.token when AUTOFIX_BOT_PAT empty on fork PRs#66562pnascimento9596 wants to merge 1 commit into
pnascimento9596 wants to merge 1 commit into
Conversation
…ork PRs Since NousResearch#66373 (597615a), fork pull_request runs get an empty secrets.AUTOFIX_BOT_PAT. Passing that empty string into detect-changes overrides the action's default github.token, so the compare API fails and the classifier fails open (ci_review=true + all lanes). The ci-review job then hard-fails on the same empty PAT at label fetch. Restore the previous fail-closed-for-auth behavior by falling back to github.token for: - detect-changes classify input (ci.yml) - CI timing report (ci.yml; read-only API) - ci-review label fetch (lint.yml) Comment-posting steps stay PAT-only (already skipped on forks).
This was referenced Jul 17, 2026
Closed
Contributor
|
Thanks for this, @pnascimento9596 — your diagnosis was spot on. The We landed the same fallback (plus the matching fix for the |
Contributor
Author
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 every fork PR broken since #66373 (merge
597615ade, 2026-07-17 ~20:55 UTC).Empty
secrets.AUTOFIX_BOT_PATon forkpull_requestruns is passed intodetect-changes, which overrides the action default (github.token). The compare API then fails (GH_TOKENempty), the classifier fails open (ci_review=true+ all lanes), and the requiredCI-sensitive file reviewjob hard-fails on the same empty PAT.Impact first
Every external contributor PR on CI-sensitive lanes (and, via fail-open, even PRs that only touch Python/docs/etc.) is red through no fault of the author. Real test/lint/docker/js/docs lanes often go green while the required aggregate fails.
Traced chain (file:line, not paraphrase)
.github/workflows/ci.yml:56—github-token: ${{ secrets.AUTOFIX_BOT_PAT }}with no|| github.tokenfallback (introduced by fix(ci): make tests, workflows, and attribution reliable under load #66373 /597615ade)..github/actions/detect-changes/action.yml:50—GH_TOKEN: ${{ inputs.github-token }}(empty string overrides action default at lines 11–12).action.yml:72–81— compare API retries 3×; on failure:::warning::compare API failed after 3 attempts — failing open (all lanes run)andCHANGED="".scripts/ci/classify_changes.py:106–114— empty file list sets all lanes true, includingci_review=true..github/workflows/ci.yml:74,78— lint workflow runs withci_review: true..github/workflows/lint.yml:174,184—ci-reviewjob runs;GH_TOKEN: ${{ secrets.AUTOFIX_BOT_PAT }}is empty → "Fetch PR labels" hard-fails after 3 retries..github/workflows/ci.yml:160–194—All required checks passsees lint failure → red required gate..github/workflows/ci.yml:227— timings job also gets empty PAT (read-only API; secondary red).Live evidence (our run + other victims)
pnascimento9596(#66475, onlyenv_loader.py— not CI files)GH_TOKEN:empty → fail-open →ci_review=true; CI-sensitive file review + All required checks pass red; pytest/ruff/docker/js/docs greenmssteuer(#66550)helix4u(#66556)roycepersonalassistantDetect log excerpt from 29615150242:
Introducing change
597615ade@ 2026-07-17T20:55:24ZFix
${{ secrets.AUTOFIX_BOT_PAT || github.token }}at:
ci_reviewis true for real CI-sensitive diffs)Comment-post steps in lint stay PAT-only (already
head.repo.fork != true).Relationship to #66559 / #66560
ci_review=true→ label fetch succeeds → "Fail on missing label" still reds every fork PR that never touched CI files.Related Issue
Fixes #66559
Type of Change
How to Test / what was verified
Meta-limitation (honest): workflow file changes from a fork do not run with the modified content on
pull_request— GitHub uses the base-branch workflow. So this PR's own CI will still demonstrate the bug (red on the same job) until a maintainer merges to main or re-runs from a same-repo branch. Frame that as live evidence, not a failure of this fix.Verified here:
github.token; present PAT → PAT.Needs maintainer eyes: merge (or same-repo re-run) to confirm fork PRs that only touch Python go green without
ci-reviewed.Checklist
Code
Documentation & Housekeeping