Skip to content

Document the workflow scope WINGET_PR_TOKEN needs - #7

Merged
setoelkahfi merged 3 commits into
mainfrom
fix/winget-pr-token-workflow-scope
Nov 8, 2026
Merged

setoelkahfi merged 3 commits into
mainfrom
fix/winget-pr-token-workflow-scope

Conversation

@setoelkahfi

Copy link
Copy Markdown
Contributor

wingetcreate fast-forwards the token owner's fork of microsoft/winget-pkgs before it branches. GitHub refuses that sync for a classic PAT without the workflow scope once an upstream commit changes a file under .github/workflows. That is what broke the sigit v1.7.10 winget run. The submit and update paths both sync the fork, so this workflow hits it the next time winget-pkgs edits a workflow file.

This adds workflow to the scope comment and to both "WINGET_PR_TOKEN is not set" error messages. No logic changes.

Before the next release, add the workflow scope to the WINGET_PR_TOKEN PAT (the value stays the same, so the secret needs no update). If the run still fails with "The forked repository could not be synced with the upstream commits", sync the token owner's winget-pkgs fork by hand and rerun.

wingetcreate fast-forwards the token owner's fork of microsoft/winget-pkgs
before it branches. GitHub refuses that sync for a classic PAT without the
workflow scope once an upstream commit changes a file under
.github/workflows, which broke sigit v1.7.10. Both the submit and update
paths sync the fork, so this workflow hits it the next time winget-pkgs
edits a workflow file.

Add workflow to the scope comment and to both "WINGET_PR_TOKEN is not set"
error messages. No logic changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only change to .github/workflows/release-winget.yml: the WINGET_PR_TOKEN scope comment gains a note that workflow is needed because wingetcreate fast-forwards the token owner's winget-pkgs fork and GitHub rejects that sync for a classic PAT without workflow once an upstream commit touches .github/workflows (the sigit v1.7.10 failure), and both "WINGET_PR_TOKEN is not set" error messages now list workflow alongside public_repo, read:org, and read:discussion. The claim checks out: pushing commits that modify workflow files to a fork requires the workflow scope on a classic PAT, and both the submit and update paths sync the fork, so both messages are correctly updated. No logic changes; nothing to flag.


Automated review by siGit Code Review · commit 1f3ec90 · see the review dashboard

Record which scopes WINGET_ISSUE_TOKEN and WINGET_PR_TOKEN need and why
workflow is one of them, plus what the fork sync error means and how to
get past it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only follow-up: adds two lines to .agents/AGENTS.md documenting that WINGET_PR_TOKEN needs the workflow scope, explaining why (wingetcreate fast-forwards the token owner's winget-pkgs fork, which GitHub rejects for a classic PAT without workflow once upstream touches .github/workflows), and giving the failure signature plus the manual-sync fallback. The workflow-scope requirement itself checks out against public reports of the same failure mode. One wording issue: the doc pins the generic sync error to a single cause.


Automated review by siGit Code Review · commit 77051ca · changes since 1f3ec90 · see the review dashboard

Comment thread .agents/AGENTS.md Resolved
@setoelkahfi setoelkahfi self-assigned this Nov 7, 2026
The sync failure is generic and also fires when the fork has drifted
behind upstream, so it cannot be pinned on a missing workflow scope
alone. Match the sentence to the fork-sync remedy it already offers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: siGit Code v1.7.6 <noreply@sigit.si>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation-only change to .agents/AGENTS.md that clarifies the WINGET_PR_TOKEN scope story for the winget release workflow. The earlier nit about the error message overstating the cause was addressed in addcc34: the text now says the sync error "can mean the PAT lacks workflow, or that the fork has simply drifted too far behind upstream", which matches the generic winget-create failure and the manual-sync remedy already in the sentence. No logic changes, and nothing else in the diff needs attention.


Automated review by siGit Code Review · commit addcc34 · changes since 77051ca · see the review dashboard

@setoelkahfi
setoelkahfi merged commit 9d28579 into main Nov 8, 2026
5 checks passed
@setoelkahfi
setoelkahfi deleted the fix/winget-pr-token-workflow-scope branch November 15, 2026 11:58
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.

3 participants