2

I've developed this github action that propagates any new merge from master/main to some chosen branches. It has been working all good for years, but these last... weeks? months? (not quite sure when it started to fail) in a private repo I've started getting 409 responses from the github API for every merge call, which corresponds to a merge conflict.

Usually those are related with conflicts that the api can't solve by itself, so it's normal to merge them manually, but if I try to merge them in my machine, they're always easily solved.

Here's an example where a change to a single file (the action file itself in my repo) wasn't merged by the action, therefore the Github API:

enter image description here

but merged without problems locally:

> git branch --show-current
release/audit-report-fix
> git pull origin master
From github.com:company/project
 * branch                  master     -> FETCH_HEAD
Merge made by the 'ort' strategy.
 .github/workflows/auto-merge.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Also trying the "Update branch" button in Github gives no problem. Before:

enter image description here

After pressing "Update branch" button:

enter image description here

Worth to mention that I didn't change anything in the GH action code. Now I've upgraded the node/octokit dependencies with the hope that it will solve the problem, but nothing has changed.
Looking the github changelog, I've found they changed the merging strategy on September that... might be related? not really sure, specially because I have the feeling this has been failing like that the last two months, but I can't tell with precision. Also I was expecting that octokit helped me with some extra parameters to define the merge strategy or something, but there's no much to configure than I'm already doing and makes sense as the API itself doesn't allow that.
I'm really lost, not sure if it has something to do with my private repo, the action or the Github API, but anyone with an idea where to go from here would be great.

Alter Lagos
  • 12,090
  • 1
  • 70
  • 92
  • That [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) suggests that it is most probably coming from the API itself. You should open an issue on its official repo. Apart from that, you might want to test this for some pubic repo (if you haven't done it already) to make sure it only results in conflicts for private repos. – Azeem Mar 16 '23 at 05:36
  • Yeah, I've asked in the github community in the past and they have been unresponsive , so it has been a waste of time so far, but I'll give a try anyway. – Alter Lagos Mar 16 '23 at 21:01
  • Right. Meanwhile, you might want to emulate your commands that work locally to another branch and see if that works instead of the `octokit`. – Azeem Mar 17 '23 at 13:01

0 Answers0