devmasx / merge-branch

A GitHub Action that merge PR branch to other branchs
161 stars 58 forks source link

Error while merging #30

Open esg-odeoliveira opened 2 years ago

esg-odeoliveira commented 2 years ago

hey, sometimes I'm getting this error during the merge phase:

Run devmasx/merge-branch@master with: type: now from_branch: release target_branch: metadata github_token: ***

/usr/local/bundle/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in "on_complete": POST https://api.github.com/repos/ORG/REPO/merges: 409 - Merge conflict // See: https://docs.github.com/rest/reference/repos#merge-a-branch (Octokit::Conflict) from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:9:in "block in call" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:61:in "on_complete" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:8:in "call" from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:73:in "perform_with_redirection" from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:61:in "call" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/request/retry.rb:130:in "call" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/rack_builder.rb:143:in "build_response" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/connection.rb:387:in "run_request" from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/connection.rb:175:in "post" from /usr/local/bundle/gems/sawyer-0.8.2/lib/sawyer/agent.rb:94:in "call" from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/connection.rb:156:in "request" from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/connection.rb:28:in "post" from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/client/commits.rb:214:in "merge" from /action/lib/index.rb:31:in "<main>"

Any ideas why is it failing?

nix1016 commented 2 years ago

409 - Merge conflict

rsodre commented 2 years ago

I'm having this error after a force push.

Isn't it the case to add a force option to ignore conflicts and always use from_branch versions?

EpsilonAlpha commented 1 year ago

I have the exact same error. Sidenote on mine is:

image

That 6 other merges running fine, but numbero 7 doesn't. The Push before worked fine:

image

Have the Problem since 27 days on my end without changing the workflow file in the meantime.

My error is:

/usr/local/bundle/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/EpsilonAlpha/saltmaster/merges: 409 - Merge conflict // See: https://docs.github.com/rest/reference/repos#merge-a-branch (Octokit::Conflict)
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:[9](https://github.com/EpsilonAlpha/saltmaster/actions/runs/3138600033/jobs/5098110177#step:4:10):in `block in call'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:61:in `on_complete'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/response.rb:8:in `call'
    from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
    from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/request/retry.rb:[13](https://github.com/EpsilonAlpha/saltmaster/actions/runs/3138600033/jobs/5098110177#step:4:14)0:in `call'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/rack_builder.rb:[14](https://github.com/EpsilonAlpha/saltmaster/actions/runs/3138600033/jobs/5098110177#step:4:15)3:in `build_response'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/connection.rb:387:in `run_request'
    from /usr/local/bundle/gems/faraday-0.17.0/lib/faraday/connection.rb:175:in `post'
    from /usr/local/bundle/gems/sawyer-0.8.2/lib/sawyer/agent.rb:94:in `call'
    from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/connection.rb:[15](https://github.com/EpsilonAlpha/saltmaster/actions/runs/3138600033/jobs/5098110177#step:4:16)6:in `request'
    from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/connection.rb:28:in `post'
    from /usr/local/bundle/gems/octokit-4.14.0/lib/octokit/client/commits.rb:[21](https://github.com/EpsilonAlpha/saltmaster/actions/runs/3138600033/jobs/5098110177#step:4:22)4:in `merge'
    from /action/lib/index.rb:26:in `<main>'

Yeah yeah, "Merge conflict" but what does it mean exactly? Is there a verbose option which gives me A LITTLE more information?

EpsilonAlpha commented 1 year ago

Okay i found the solution @esg-odeoliveira and i'm sure this will work better than people just requoting the error message without giving any hint.

You create a new pull request on GitHub and like that "imiating" what the github action should do, merging the exact same branches. In my case that gave me 2 files which are missmatching.