alexwilson / enable-github-automerge-action

Speed up your workflows by automatically enabling Auto-Merge in your Github pull-requests, so you can release when ready.
https://github.com/marketplace/actions/enable-github-automerge
ISC License
21 stars 5 forks source link

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

Open alexwilson opened 3 years ago

alexwilson commented 3 years ago

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 commented 3 years ago

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

JakeChampion commented 3 years ago

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 commented 3 years ago

@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

alexwilson commented 3 years ago

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?

JakeChampion commented 3 years ago

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