microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
477 stars 82 forks source link

`wingetcreate.exe` fails with `Unable to create a reference to the forked repository` #473

Closed rednoah closed 8 months ago

rednoah commented 8 months ago

Brief description of your issue

wingetcreate.exe fails with the following error message:

Unable to create a reference to the forked repository. This can be caused when the forked repository is behind by too many commits. Sync your fork and try again.

Unfortunately, the error message doesn't really tell us anything. wingetcreate.exe presumably forks the latest package repository so the error message doesn't make sense to me. Does wingetcreate.exe have a -verbose flag?

Steps to reproduce

I'm using the following GitHub action:

You can find the GitHub CI log here: https://github.com/filebot/plugins/actions/runs/6782204951/job/18433976886

Expected behavior

wingetcreate.exe should work or print a useful error message.

Actual behavior

wingetcreate.exe doesn't work.

Environment

GitHub Action `windows-latest` running the `https://aka.ms/wingetcreate/latest` executable.
Trenly commented 8 months ago

@rednoah - It looks like you're more than 90,000 commits behind master on https://github.com/rednoah/winget-pkgs. Merging in the latest commits from microsoft/winget-pkgs should resolve the issue.

Edit: I see you have some changes to your master branch that would prevent a clean merge commit; It looks like those changes are already part of microsoft/winget-pkgs, so you might have to revert those commits in order to get the merge to work

rednoah commented 8 months ago

Cheers! That was the key. I deleted my rednoah/winget-pkgs (can't remember forking it in the first place) and now it works. Thank you very much for the help. Checking for forks in my accounts would never have occured to me.

Trenly commented 8 months ago

Cheers! That was the key. I deleted my rednoah/winget-pkgs (can't remember forking it in the first place) and now it works. Thank you very much for the help. Checking for forks in my accounts would never have occured to me.

If the fork doesn't exist, wingetcreate will automatically re-create it, since the fork is needed to generate a PR. If you check, you'll see you now have a new version of the fork

nett00n commented 5 months ago

For the future users with this problem.

There is a problem with your very own fork of winget-pkgs.

How to fix

mdanish-kh commented 5 months ago

For the future users:

* Go to **your profile** on GitHub web page

* Go to your repositories

* Find there `winget-pkgs` repo

* Press the `sync fork` button there

That's certainly an option if you're doing things manually but may not be the most suitable option if you're automating the releases in a CI/CD pipeline. You can sync the repo using gh CLI if you're using wingetcreate in a CI environment, I'll link a couple of examples: