github-repo-automation
github-repo-automation copied to clipboard
Add a command to enable auto merge
Is your feature request related to a problem? Please describe. It would be nice to queue a merge once required status checks had passed.
Describe the solution you'd like
Now that GitHub supports auto merge it would be great if there was a new command repo automerge ... that enabled it. Maybe this could also attempt to enable the option on the repo if it's disabled too.
Not sure if it's possible to enable from the API yet, but it probably will be soon
Hey! I recently built a Github Action which allows enabling auto-merge in workflows, which may help.
If you're interested in how to enable auto-merge programmatically, it isn't exposed via REST (that I could see) but it is exposed via a graphQL mutations, and there's a working example here: https://github.com/alexwilson/enable-github-automerge-action/blob/main/src/enable-github-automerge-action.ts#L115-L135
Documentation on the mutation in question here: https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge
Nice thanks for the info!