ci(release): sync the winget fork before submitting the manifest - #188
Merged
Conversation
wingetcreate refuses to open a PR from a fork that has drifted from upstream: "The forked repository could not be synced with the upstream commits. Sync your fork manually and try again." That blocked winget for 0.17.3 — the manifest built and validated, then failed at submission — and it recurs whenever microsoft/winget-pkgs touches .github/workflows, because syncing a fork carrying workflow files needs the `workflow` scope that a plain OAuth token lacks. Clearing it by hand costs a manual round trip and a job re-run each time. The release job now calls the server-side merge-upstream endpoint first, with WINGET_TOKEN (a PAT, which has the scope). No checkout needed. Best-effort and wrapped in try/catch: a fresh fork, or none yet, must not fail the release — the submit step keeps its own continue-on-error for the moderation cases. Owner comes from github.repository_owner rather than being hardcoded, matching how the rest of the workflow addresses the repo. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
wingetcreaterefuses to open a PR from a fork that has drifted from upstream:That blocked winget for 0.17.3 — the manifest built and validated, then failed at submission — and it recurs whenever
microsoft/winget-pkgstouches.github/workflows, because syncing a fork that carries workflow files needs theworkflowscope a plain OAuth token lacks:Clearing it by hand costs a manual round trip plus a job re-run each time.
Change
The release job calls the server-side
merge-upstreamendpoint beforewingetcreate, usingWINGET_TOKEN(a PAT, which has the scope). No checkout needed — the sync happens entirely on GitHub's side.Best-effort and wrapped in
try/catch: a fresh fork, or none at all, must not fail the release. The submit step keeps its owncontinue-on-errorfor the moderation cases it already tolerated.Owner comes from
github.repository_ownerrather than being hardcoded, matching how the rest of the workflow addresses the repo.Verified by hand today
After
gh auth refresh -s workflow, syncing the fork moved it to upstream's head (91fdec2e1on both) and the re-run submitted microsoft/winget-pkgs#417355 — "New version: yeroo.agwinterm version 0.17.3". This change makes that automatic.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code