github-repo-automation icon indicating copy to clipboard operation
github-repo-automation copied to clipboard

Add a command to enable auto merge

Open tjenkinson opened this issue 4 years ago • 2 comments

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

tjenkinson avatar Feb 27 '21 10:02 tjenkinson

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

alexwilson avatar Mar 07 '21 17:03 alexwilson

Nice thanks for the info!

tjenkinson avatar Mar 07 '21 19:03 tjenkinson