Enabling auto merge on a PR using the API

Hi,

We’re very excited with the new Beta Auto merge feature for pull requests.

I did not see any way to enable auto merge on a pull request using the REST API at https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls - is that already available?

Many thanks,
Damien

7 Likes

Still no news regarding this. We are also interested in such API.

Just in case, another topic being duplicate of this one: enable-auto-merge-for-repository-via-api-v3

her topic being duplicate of this one: enable-auto-merge-for-repository-via-api-v3

As far as I can see this one is about the flag in the pull request itself and the other one is about the setting in the repository. So to me they are not actually duplicates, but maybe I got that wrong?

By now the auto-merge is also not in beta anymore, so I would have expected a flag in the API by now :thinking:

Enabling auto-merge for a PR is now possible through the GraphQL API using the enablePullRequestAutoMerge mutation.

However, there doesn’t seem to be an API endpoint to enable this feature at repository level.

2 Likes

Is there a way to auto-merge PRs using this API that automatically pass all checks?
e.g. always merge everything from dependabot if it works.

1 Like

How can I use it for auto-merge my PR via code?