I have permission, the repo allows it. I create a bunch of PRs using a cli tool and then I have to go open N tabs and double click the Enable Auto-Merge -> Confirm process for each one.
Does the API offer an issue/pr modify method to set this attribute automatically without resorting to the UI?
I solved it like this: Request POST to https://api.github.com/graphql to get pullRequestID value body:
query MyQuery {
    repository(name: "repo-example", owner: "org-example) {
        pullRequest(number: 49) {
                  id
              }
        } 
}
With pullRequest ID make a mutation: Request POST to https://api.github.com/graphql
mutation MyMutation {
    enablePullRequestAutoMerge(input: {pullRequestId: "$pullRequestID", mergeMethod: MERGE}) {
        clientMutationId
         }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With