From 1f3ec90cde3ff781a08b13a63db5030f152027e1 Mon Sep 17 00:00:00 2001 From: Seto Elkahfi Date: Sat, 7 Nov 2026 13:27:29 +0100 Subject: [PATCH 1/3] Document the workflow scope WINGET_PR_TOKEN needs 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 --- .github/workflows/release-winget.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml index bd7887f..4bd6bab 100644 --- a/.github/workflows/release-winget.yml +++ b/.github/workflows/release-winget.yml @@ -98,6 +98,10 @@ jobs: # calls `gh pr edit`, whose GraphQL query resolves # org/team and discussion fields and fails with a # scope error without them. + # WINGET_PR_TOKEN also needs workflow: wingetcreate fast-forwards the token + # owner's fork before it branches, and GitHub refuses that sync when an + # upstream commit changed a file under .github/workflows (seen on sigit + # v1.7.10). - name: File the winget Package Request issue id: issue shell: bash @@ -206,7 +210,7 @@ jobs: WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_PR_TOKEN }} run: | if (-not $env:WINGET_CREATE_GITHUB_TOKEN) { - Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, and read:discussion scopes so wingetcreate can fork microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." + Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, read:discussion, and workflow scopes so wingetcreate can sync its fork of microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." } $version = "${{ steps.release.outputs.version }}" @@ -240,7 +244,7 @@ jobs: WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_PR_TOKEN }} run: | if (-not $env:WINGET_CREATE_GITHUB_TOKEN) { - Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, and read:discussion scopes so wingetcreate can fork microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." + Write-Error "WINGET_PR_TOKEN is not set. It needs a PAT with public_repo, read:org, read:discussion, and workflow scopes so wingetcreate can sync its fork of microsoft/winget-pkgs and open the manifest PR, and gh can edit the PR body." } $tag = "${{ steps.release.outputs.tag }}" From 77051ca5003fbce0f67739e568019664a87f0db0 Mon Sep 17 00:00:00 2001 From: Seto Elkahfi Date: Sat, 7 Nov 2026 13:53:29 +0100 Subject: [PATCH 2/3] Document the winget token scopes in AGENTS.md 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 --- .agents/AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index adb2676..58a6bdd 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -41,3 +41,5 @@ Things that span files: Push a `v*` tag matching the `[workspace.package]` version in the root `Cargo.toml`; `release-github.yml` builds five targets (macOS arm64/x64, Linux arm64/x64, Windows x64) and attaches archives plus `checksums.txt`. `release-npm.yml` ("Code Release npm") runs on the same tag and publishes `@ondeinference/onde-code` (a Node launcher in `packaging/npm/onde-code`) plus five platform packages, `@ondeinference/onde-code-{darwin-arm64,darwin-x64,linux-x64,linux-arm64,windows-x64}`. Auth is npm Trusted Publishing; npm authenticates with OIDC, not a token. Trusted Publishers are configured per package (all six point at `release-npm.yml`), so a new package needs one before its first CI publish; run `packaging/npm/scripts/setup-trusted-publishing.sh` to create and attach them. Verify with `npm view @ondeinference/onde-code version`. + +**winget:** `release-winget.yml` files the Package Request issue with `WINGET_ISSUE_TOKEN` (`public_repo`), then opens the manifest PR with `WINGET_PR_TOKEN`, a classic PAT with `public_repo`, `read:org`, `read:discussion`, and `workflow`. The first three cover forking and the `gh pr edit` GraphQL query. `workflow` is there because wingetcreate fast-forwards the token owner's fork before it branches, and GitHub refuses that sync once an upstream commit changes a file under `.github/workflows`. "The forked repository could not be synced with the upstream commits" means the PAT lacks `workflow`; add it, or sync the fork by hand and rerun. From addcc3413b586a049715846fb3918f0576d223c1 Mon Sep 17 00:00:00 2001 From: Seto Elkahfi Date: Sun, 8 Nov 2026 10:32:43 +0100 Subject: [PATCH 3/3] Soften the winget fork-sync error attribution 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 Co-Authored-By: siGit Code v1.7.6 --- .agents/AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md index 58a6bdd..7bd7fb5 100644 --- a/.agents/AGENTS.md +++ b/.agents/AGENTS.md @@ -42,4 +42,4 @@ Push a `v*` tag matching the `[workspace.package]` version in the root `Cargo.to `release-npm.yml` ("Code Release npm") runs on the same tag and publishes `@ondeinference/onde-code` (a Node launcher in `packaging/npm/onde-code`) plus five platform packages, `@ondeinference/onde-code-{darwin-arm64,darwin-x64,linux-x64,linux-arm64,windows-x64}`. Auth is npm Trusted Publishing; npm authenticates with OIDC, not a token. Trusted Publishers are configured per package (all six point at `release-npm.yml`), so a new package needs one before its first CI publish; run `packaging/npm/scripts/setup-trusted-publishing.sh` to create and attach them. Verify with `npm view @ondeinference/onde-code version`. -**winget:** `release-winget.yml` files the Package Request issue with `WINGET_ISSUE_TOKEN` (`public_repo`), then opens the manifest PR with `WINGET_PR_TOKEN`, a classic PAT with `public_repo`, `read:org`, `read:discussion`, and `workflow`. The first three cover forking and the `gh pr edit` GraphQL query. `workflow` is there because wingetcreate fast-forwards the token owner's fork before it branches, and GitHub refuses that sync once an upstream commit changes a file under `.github/workflows`. "The forked repository could not be synced with the upstream commits" means the PAT lacks `workflow`; add it, or sync the fork by hand and rerun. +**winget:** `release-winget.yml` files the Package Request issue with `WINGET_ISSUE_TOKEN` (`public_repo`), then opens the manifest PR with `WINGET_PR_TOKEN`, a classic PAT with `public_repo`, `read:org`, `read:discussion`, and `workflow`. The first three cover forking and the `gh pr edit` GraphQL query. `workflow` is there because wingetcreate fast-forwards the token owner's fork before it branches, and GitHub refuses that sync once an upstream commit changes a file under `.github/workflows`. "The forked repository could not be synced with the upstream commits" can mean the PAT lacks `workflow`, or that the fork has simply drifted too far behind upstream; add the scope, or sync the fork by hand and rerun.