paygoc6 / action-pull-request-another-repo

Action for create pull request in another repository
Apache License 2.0
38 stars 83 forks source link

updating an existing open PR fails (non-fast-forward merge) #22

Open david-alpert-nl opened 1 year ago

david-alpert-nl commented 1 year ago

when I reran this action against an open PR it failed with this error message

Pushing git commit
+ git push -u origin HEAD:branch-name
To https://github.com/org/repo.git
 ! [rejected]        HEAD -> branch-name (non-fast-forward)
error: failed to push some refs to 'https://github.com/org/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

In our use case we would want this to force-update if it changes before we get it merged in the downstream repo.

It looks like this is already addressed by @jacopocarlini in #19

could we get PR that merged please?

jacopocarlini commented 1 year ago

Hi @david-alpert-nl, thank you for quoting me.

For the moment, you can use my modified action.

      - name: Create pull request
        uses: jacopocarlini/action-pull-request-another-repo@main
        env:
          API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
        with:
          allow_force_push: 'true'
          ...

I hope this PR will be merged soon