fix: use scoped PAT for dist/ regenerate auto-PR, not default GITHUB_TOKEN - #137
Merged
Merged
Conversation
…TOKEN
The regenerate-records-json workflow has been failing on every run since
at least 2026-07-28 ('GitHub Actions is not permitted to create or
approve pull requests') -- the repo's 'Allow GitHub Actions to create
and approve pull requests' setting is off, which blocks
peter-evans/create-pull-request when it falls back to the default
GITHUB_TOKEN, and that setting is deliberately left off repo-wide so no
other workflow picks up PR-creation rights it doesn't need.
Point only this step at DIST_SYNC_PR_TOKEN, a fine-grained PAT scoped
to this repo (contents + pull-requests: read/write, nothing else).
Earlier steps (checkout, npm ci, build-records.js) keep using the
default GITHUB_TOKEN.
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
regenerate-records-jsonworkflow has failed on every single runsince at least 2026-07-28 (11 consecutive failures) at its "Open PR if
dist/ changed" step:
peter-evans/create-pull-request@v8had notoken:input, so it fellback to the default
GITHUB_TOKEN. This repo has "Allow GitHub Actionsto create and approve pull requests" off (confirmed via
gh api repos/aveproject/ave/actions/permissions/workflow->can_approve_pull_request_reviews: false), which hard-gates PR creationregardless of the
permissions:block declared in the workflow YAML.Fix
Point only the PR-creation step at
DIST_SYNC_PR_TOKEN, a fine-grainedPAT scoped to
aveproject/aveonly (contents+pull requests:read/write, real expiration set, nothing else). This is narrower than
flipping the repo-wide toggle, which would hand every workflow in this
repo PR-creation rights it doesn't need. Earlier steps (checkout,
npm ci,build-records.js) are untouched and keep using the defaultGITHUB_TOKEN.Verification
Can't fully verify until this merges to
develop-- the workflow onlytriggers on push to
developtouchingrecords/. Once merged, the nextrecords/change landing ondevelop(e.g. the pending AVE-2026-00075PR) will be the real end-to-end trigger. Flagging that as the follow-up
check rather than claiming it's proven green here.