Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING BEHAVIOR: WingetCreate fails to create a pull request #580

Closed
mdanish-kh opened this issue Jan 9, 2025 · 0 comments · Fixed by #581
Closed

BREAKING BEHAVIOR: WingetCreate fails to create a pull request #580

mdanish-kh opened this issue Jan 9, 2025 · 0 comments · Fixed by #581

Comments

@mdanish-kh
Copy link
Contributor

mdanish-kh commented Jan 9, 2025

Issue

There appears to be a breaking change somewhere in the Octokit .NET API / GitHub API for Updating a ref. The code is throwing an exception when trying to update the fork with upstream commits

await this.github.Git.Reference.Update(forkedRepo.Id, $"heads/{forkedRepo.DefaultBranch}", new ReferenceUpdate(upstreamBranchReference.Object.Sha));

The inner exception seems to be Object reference does not exist

Who does this affect

Anyone using wingetcreate update with --submit flag or using wingetcreate submit command. If their fork is out of sync with upstream microsoft/winget-pkgs, wingetcreate would first try to sync their fork and encounter the exception

Affected versions

This code has been the same for most versions of WinGet-Create, so almost all versions of winget-create would be failing

Workaround

The immediate workaround would be to sync your winget-pkgs fork manually before calling wingetcreate. You can do this via gh CLI using gh repo sync or via the GitHub UI. If you're using wingetcreate in a CI environment, you can add a step like

- name: Sync winget-pkgs fork
  run: gh repo sync <fork-owner>/winget-pkgs -b master
  env:
    GH_TOKEN: ${{ secrets.<TOKEN> }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant