ci(spec-sync): use fine-grained PAT and bump pinned actions to Node-24#13
Merged
Conversation
The nightly spec-sync workflow has been failing every day since 2026-04-28 with `GitHub Actions is not permitted to create or approve pull requests`. Root cause is the voltagepark org policy that forbids `GITHUB_TOKEN` from creating or approving PRs; the per-repo toggle is overridden by org policy and we don't want to weaken the org policy for this single bot. Switch the workflow to a fine-grained PAT (`secrets.GH_PAT`) scoped to this repo only with `Contents: read+write` and `Pull requests: read+write`. Pass the PAT to both `actions/checkout` (so the spec-sync/auto branch push lands as the PAT identity) and `peter-evans/create-pull-request` (so the create/update-PR call lands under the same identity). Drop workflow-level `contents: write` / `pull-requests: write` since the PAT carries those rights now and GITHUB_TOKEN no longer needs them. While here, bump the pinned actions to their Node-24-compatible majors ahead of the 2026-06-02 deprecation cutover: - actions/checkout v4 -> v5 - actions/setup-python v5 -> v6 - peter-evans/create-pull-request v6 -> v8 No behavior change to the regenerate / test path; only auth and runtime versions move.
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
Fix the nightly
spec-syncworkflow, which has been failing every day since 2026-04-28 with:The root cause is the
voltageparkorg policy that forbidsGITHUB_TOKENfrom creating or approving PRs. The per-repo toggle (Settings → Actions → General → Workflow permissions → "Allow GitHub Actions to create and approve pull requests") is overridden by the org policy, and we'd rather not weaken the org policy for this single bot — the principle of least privilege says scope the capability to just this workflow.This PR switches the workflow from
secrets.GITHUB_TOKENto a fine-grained PAT (secrets.GH_PAT) and bumps the pinned actions to their Node-24-compatible majors ahead of the 2026-06-02 GitHub Actions deprecation cutover.Required before merging
The repo needs a new secret
GH_PATcontaining a fine-grained personal access token with:voltageparkgraphn-sdk-python)Contents: Read and write (pushspec-sync/autobranch)Pull requests: Read and write (create / update the PR)Metadata:Read(auto-required)Once the secret is added, this PR can merge and the nightly run (or a manual
workflow_dispatch) will succeed end-to-end.What changed
permissions:block at the workflow level dropped fromcontents: write/pull-requests: writetocontents: read. The PAT carries the write rights now;GITHUB_TOKENno longer needs them.actions/checkout@v4→@v5(Node 24, released 2025-08-11).actions/setup-python@v5→@v6(Node 24, released 2025-09-04).peter-evans/create-pull-request@v6→@v8(Node 24, released 2025-12-09; v7 was still Node 20).token:arg onactions/checkoutandpeter-evans/create-pull-requestset to${{ secrets.GH_PAT }}so the branch push and the create-PR call land under the same identity.What did not change
spec-sync/auto), commit message, PR title, PR body, labels — all identical, so the bot's output looks the same as before.workflow_dispatchinputs — unchanged.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/spec-sync.yml'))"parses cleanly.GH_PATsecret to the repo (manual, see "Required before merging" above).workflow_dispatchon this branch (or after merge) and confirm the bot opens / updates a PR. Expected outcome: either a no-op (spec hasn't changed since the last successful run) or an updated PR onspec-sync/auto.Related