Skip to content

ci: sync winget-pkgs fork before submitting manifest - #596

Open
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
microsoft:mainfrom
yeelam-gordon:dev/yeelam/winget-fork-sync
Open

ci: sync winget-pkgs fork before submitting manifest#596
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
microsoft:mainfrom
yeelam-gordon:dev/yeelam/winget-fork-sync

Conversation

@yeelam-gordon

Copy link
Copy Markdown
Contributor

Problem

The Publish to WinGet workflow failed for the v0.2 release (run 31422164208):

Manifest validation succeeded: True
Submitting pull request for manifest...
The forked repository could not be synced with the upstream commits. Sync your fork manually and try again.

The manifest itself was fine — the failure was entirely in wingetcreate's submit step. wingetcreate can only fast-forward the token owner's winget-pkgs fork when it is reasonably current. Between releases the fork drifted to 11,902 commits behind / 0 ahead of microsoft/winget-pkgs, and the fast-forward attempt failed.

Immediate remediation (already done)

The fork was synced via the merge-upstream API and the job re-run, which succeeded and produced microsoft/winget-pkgs#415289 for 0.2.2192.0.

This change

Adds a best-effort pre-sync step that fast-forwards the token owner's fork before wingetcreate runs, so the same drift can't break a future release.

  • continue-on-error: truewingetcreate still attempts its own sync, so a transient API error must not fail the release.
  • The fork owner is resolved from the token (gh api user) rather than hard-coded.
  • merge-upstream is non-destructive: it only fast-forwards, and returns 409 (ignored) if it cannot.

The Publish to WinGet workflow failed for v0.2 with 'The forked repository
could not be synced with the upstream commits.' wingetcreate can only
fast-forward a fork that is not too far behind; between releases the fork
had fallen ~11,900 commits behind microsoft/winget-pkgs.

Add a best-effort pre-sync step that fast-forwards the token owner's fork
via the merge-upstream API before wingetcreate runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 27d9112c-7ed9-41c4-9dda-5dbef425d66c
Copilot AI lite review requested due to automatic review settings August 11, 2026 05:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the Publish to WinGet GitHub Actions workflow by adding a best-effort pre-sync of the winget-pkgs fork before invoking wingetcreate, preventing releases from failing when the fork has drifted far behind upstream.

Changes:

  • Add a continue-on-error step that resolves the token owner (gh api user) and fast-forwards their winget-pkgs fork via merge-upstream before manifest submission.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants