fix(ci): use GITHUB_TOKEN instead of SYNC_PAT for upstream-sync#29
Merged
Conversation
The Upstream Sync workflow has failed every scheduled run since it was added — actions/checkout fails at fetch with "could not read Username for 'https://github.com': terminal prompts disabled", indicating SYNC_PAT is set but invalid (likely expired, revoked, or lacking required scopes). The job only needs to (a) push a throwaway branch to this repo and (b) open a PR. Both are already granted by the workflow's existing permissions block (contents: write, pull-requests: write), which the built-in GITHUB_TOKEN honors. The push doesn't need to trigger downstream workflows, so GITHUB_TOKEN's recursive-trigger restriction doesn't apply here. Removes the need to manage a rotating PAT.
3 tasks
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
actions/checkouterrors at the fetch step withfatal: could not read Username for 'https://github.com': terminal prompts disabled— symptom of a token that's set but invalid (expired, revoked, or wrong scopes).permissions:block (contents: write,pull-requests: write), which the built-inGITHUB_TOKENhonors.SYNC_PAT→GITHUB_TOKENremoves the rotating-PAT maintenance burden entirely.Why GITHUB_TOKEN is sufficient here
GITHUB_TOKENpushes don't trigger other workflow runs — that restriction does not apply to this job, since the throwaway branch push isn't intended to trigger anything downstream. The PR creation viagh pr createworks withGITHUB_TOKENbecause the job already declarespull-requests: write.Test plan
Upstream Syncmanually viaworkflow_dispatch(the next scheduled run is daily at 09:00 UTC, but a manual run validates faster)SYNC_PATrepo secret