ci(lint): fix invalid GitHub PAT format in lint-changed-files#242
Merged
Conversation
The R `gh` package reads `GITHUB_PAT` and runs `validate_gh_pat()` on it.
The auto-provisioned `secrets.GITHUB_TOKEN` is now a `ghs_`-style
server-to-server token whose format `gh` rejects, so the "Extract and
lint files changed by this PR" step aborts with "Invalid GitHub PAT
format" before any linting runs.
Unset `GITHUB_PAT` and pass the token explicitly via `.token=` (which
skips the PAT format check), with `GITHUB_TOKEN: ${{ github.token }}`
on the step. Mirrors the fix already applied in the shigella repo.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Claude finished @d-morrison's task in 1m 1s —— View job Code Review
Overall: Correct fix, clean implementation. Approved. The PR correctly identifies and resolves the root cause: the R What the fix does
Minor notes
No bugs, security issues, or logic problems found. The fix mirrors the pattern used in the shigella repo and is the standard approach for this class of problem with the R |
Codecov Report✅ All modified and coverable lines are covered by tests. |
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
lint-changed-filesjob has been failing on PRs (e.g. run on #241) with:Root cause: the R
ghpackage reads theGITHUB_PATenv var and runsvalidate_gh_pat()on it. The auto-provisionedsecrets.GITHUB_TOKENis now aghs_-style server-to-server token whose formatghrejects (it only accepts 40-hex,ghp_, orgithub_pat_). So the "Extract and lint files changed by this PR" step aborts before any linting runs.see r-lib/gh#231 and r-lib/gh#232 for details
Fix
Unset
GITHUB_PATand pass the token explicitly via.token=(which bypasses the PAT format check), settingGITHUB_TOKEN: ${{ github.token }}on the step. This mirrors the fix already applied in the shigella repo.Once merged into
main, branches (including #241) will pick it up after mergingmainin.🤖 Generated with Claude Code