update-flake-lock icon indicating copy to clipboard operation
update-flake-lock copied to clipboard

Failure on Gitea/Forgejo

Open font44 opened this issue 1 year ago • 3 comments

This Action fails with the following error on Forgejo (and I am guessing on Gitea as well):

Persisted git credentials restored
[command]/usr/bin/git config --global --unset safe.directory /workspace/ketan/nix-config
  ❓  ::endgroup::
::endgroup::
  ❌  Failure - Main Create PR
exitcode '1': failure
expression '${{ steps.create-pr.outputs.pull-request-number }}' rewritten to 'format('{0}', steps.create-pr.outputs.pull-request-number)'
evaluating expression 'format('{0}', steps.create-pr.outputs.pull-request-number)'
expression 'format('{0}', steps.create-pr.outputs.pull-request-number)' evaluated to '%!t(string=)'
  ⚙  ::set-output:: pull-request-number=
expression '${{ steps.create-pr.outputs.pull-request-operation }}' rewritten to 'format('{0}', steps.create-pr.outputs.pull-request-operation)'
evaluating expression 'format('{0}', steps.create-pr.outputs.pull-request-operation)'
expression 'format('{0}', steps.create-pr.outputs.pull-request-operation)' evaluated to '%!t(string=)'
  ⚙  ::set-output:: pull-request-operation=
  ❌  Failure - Main Update flake.lock
exitcode '1': failure

As you can see, it fails in the last step while trying to create a pull request. I think that's because a dependency - peter-evans/create-pull-request@v6 here - is hard coded to use GitHub and doesn't support Gitea/Forgejo. (See this issue on that project.)

font44 avatar Jun 13 '24 13:06 font44

I don't really believe that it's really related to this. I've forked this and changed the version to v7 (currently v7.0.5) and I get the following error:

Create or update the pull request
Attempting creation of pull request
::error::Not found.%0A

So far I wasn't able to get enough more information on why this fails. This happens with both the original version and my modified version. I'll try to get more information as I learn how GitHub Actions are created.

jiriks74 avatar Dec 13 '24 17:12 jiriks74

I was able to track down the issue!

The issue is upstream at https://github.com/peter-evans/create-pull-request

The action uses the wrong API URL for Forgejo/Gitea:

https://github.com/peter-evans/create-pull-request/blob/16e0059bfd236716f0191bfcfa63d9ded4cf325f/dist/index.js#L1287

The API endpoint is set to /api/v3 but the API endpoint for Forgejo/Gitea is /api/v1 so requests to /api/v3 result in a 404 and therefore error I mentioned above.

This issue is already reported upstream: https://github.com/peter-evans/create-pull-request/issues/3569

If you want to get a working action until this gets fixed upstream and updated here you I've made a working workflow file:

https://forgejo.stefka.eu/jiriks74/nix.nvim/src/commit/12de97a2cde35cd1afc642853d8e617753680367/.github/workflows/update.yml

[!Note] Don't forget to modify the file to your liking. It's made for my use so you should probably change some things.

jiriks74 avatar Dec 15 '24 04:12 jiriks74

I made a working version fork (just a temporal fix): https://github.com/DerDennisOP/update-flake-lock

DerDennisOP avatar Nov 23 '25 09:11 DerDennisOP