-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not automerge when "branch is out-of-date with the base branch" #74
Comments
same issue here, will subscribe to comments |
I just tried again in my test repository, but cannot reproduce the error. I used the exact same config that you have: name: automerge
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/automerge-action@135f0bdb927d9807b5446f7ca9ecc2c51de03c4a"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_REMOVE_LABELS: "automerge" I also made sure that the branch was behind (GH shows "This branch is out-of-date with the base branch" message) After the build has run (CircleCI in my case), automerge is triggered correctly:
|
@pascalgn Thanks for checking! Did you manually click the "Update branch" button? I didn't, and was hoping automerge would take care of this initial merge too. |
No, I did not click that button manually, that's what the action is supposed to do. You can see it in lines 3 in the logs I posted:
(it's from https://github.com/pascalgn/automerge-action/blob/master/lib/update.js#L102) |
I removed the label, waited for the action to finish, then added it again and got the same log as before:
It didn't merge the master into the PR (so the CI didn't trigger), as it thought it was clean:
Could it be because it's with a private repo? @progapandist Is it happening for you with a private repo too? I'll try and reproduce it in a public repo or a dummy private repo which I can then make public. |
Exactly, private repo for me too! My required check is also an Action one, and I test again after merge so I have to use a private token too that’s not the repo admin, but has a write access |
Reproduced on a public repo: hugovk/test#24 Branch protection rules are same as above (except without "Require pull request reviews before merging" because I can't approve my own PRs): When I added the
https://github.com/hugovk/test/pull/24/checks?check_run_id=686145556 But it didn't do any merges. Again, the same thing:
|
Getting closer! On hugovk/test#24:
Does it need the retry timeout to be long enough to wait for the CI to finish? |
Ah, yes, that's to be expected. After the build is finished, a |
However it does not get triggered if the check is also a GHA. would love to know workarounds for that one! 🙏 |
Yes, unfortunately that's a limitation of GH actions, as also mentioned here: https://github.com/pascalgn/automerge-action#limitations. If you do come across a workaround for it, let me know! 👍 |
I think the original issue is fixed now. However, feel free to reopen this or create a new issue if you disagree or if there are any other problems! 👍 |
Yes, I think so too. It's a bit of a problem with private repos where minutes are in a quota/billed, but thank you for the help! |
This may be related to Github Actions, but there are other approaches to automating merges as well. One that I've used in past is https://mergequeue.com that does not use Github Action to manage automerge, so some of the limitations here can be overcome. It also support auto-rebasing. |
In a private repo, using default config from the README, with added
MERGE_REMOVE_LABELS
:We have branch protection rules like this:
The PR to add this action was approved by two people (1 approval is required). The master branch had since moved forward from other PRs, meaning normally I need to manually click this button, wait ~5 minutes for CI to pass, before I can manually merge:
Instead, I added the
automerge
label, and the action was triggered but failed to merge:I expected it would merge master into the PR, wait for the checks to pass, and then merge the PR into master.
The checks looks like this:
This looks wrong, "Travis CI - Branch" is green:
So the PR is in a clean mergeable state, but branch protection rules require master to be merged into the PR branch, before the PR can be merged into master.
Is it possible for this action to do the update from master into the PR? Basically the same as clicking that button?
The text was updated successfully, but these errors were encountered: