Skip to content

fix(ci): use GITHUB_TOKEN instead of SYNC_PAT for upstream-sync#29

Merged
bdruth merged 1 commit into
flexfrom
fix/upstream-sync-use-github-token
May 20, 2026
Merged

fix(ci): use GITHUB_TOKEN instead of SYNC_PAT for upstream-sync#29
bdruth merged 1 commit into
flexfrom
fix/upstream-sync-use-github-token

Conversation

@bdruth
Copy link
Copy Markdown

@bdruth bdruth commented May 20, 2026

Summary

  • The Upstream Sync workflow has failed every scheduled run since it was added. actions/checkout errors at the fetch step with fatal: 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).
  • This job only needs to push a throwaway branch to this repo and open a PR. Both are covered by the workflow's existing permissions: block (contents: write, pull-requests: write), which the built-in GITHUB_TOKEN honors.
  • Switching from SYNC_PATGITHUB_TOKEN removes the rotating-PAT maintenance burden entirely.

Why GITHUB_TOKEN is sufficient here

GITHUB_TOKEN pushes 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 via gh pr create works with GITHUB_TOKEN because the job already declares pull-requests: write.

Test plan

  • Merge this PR
  • Trigger Upstream Sync manually via workflow_dispatch (the next scheduled run is daily at 09:00 UTC, but a manual run validates faster)
  • Confirm the checkout step succeeds and the workflow exits cleanly (or opens a PR if there's a new upstream tag)
  • Optionally, remove the now-unused SYNC_PAT repo secret

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.
@bdruth bdruth merged commit 6f730f4 into flex May 20, 2026
@bdruth bdruth deleted the fix/upstream-sync-use-github-token branch May 20, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant