enable-github-automerge-action icon indicating copy to clipboard operation
enable-github-automerge-action copied to clipboard

Cannot create an auto-merge request when all requirements have already been passed

Open alexwilson opened this issue 4 years ago • 5 comments

When all PR requirements have already been met, it's not possible to enable auto-merge. Confusingly GitHub's API doesn't return an error message when this has happened.

alexwilson avatar Mar 10 '21 21:03 alexwilson

I'm not sure what the "correct" thing to do here should be. Options include:

  1. Check for any pending requirements, and fail the workflow when there are none
  2. Attempt to "merge" when requirements have been met?

To work around this in this repository, I ordered the approval task after the auto-merge one: https://github.com/alexwilson/enable-github-automerge-action/blob/main/.github/workflows/auto-merge-dependabot.yml

alexwilson avatar Mar 15 '21 12:03 alexwilson

I think it would be perfectly fine to document that the auto-merge should be one of the first steps in a workflow, and that it should definitely run before any automatic approval step.

JakeChampion avatar Mar 15 '21 16:03 JakeChampion

@alexwilson, it looks like this also happens if there are no required checks on a project. -- https://github.com/Financial-Times/origami-specialist-title-logos/pull/66

JakeChampion avatar Mar 18 '21 12:03 JakeChampion

Yeah, I'm not sure what we should do in that case @JakeChampion. Is using this library a fair enough intent that a user does want something to be merged, even with no checks?

Perhaps a new configuration option would accommodate this?

alexwilson avatar Mar 29 '21 09:03 alexwilson

Yeah, I'm not sure what we should do in that case @JakeChampion. Is using this library a fair enough intent that a user does want something to be merged, even with no checks?

Perhaps a new configuration option would accommodate this?

I personally would want the action by default to error out in the scenario where there are no required checks with a message which gives the different ways to stop it erroring out: Way 1 - Turn on a setting in the action's config to not error if no required checks Way 2 - Add at-least one required check to the project

JakeChampion avatar Mar 29 '21 12:03 JakeChampion