-
Notifications
You must be signed in to change notification settings - Fork 764
Description
I've been using the API to generate PRs for our main repository in a similar vein to dependabot, and would really like to be able to set those to auto-merge (which has been allowed in our repository):
ghPullRequest.requestAutoMerge();
Clearly this isn't supported by the Java API, presumably because it's not supported by the GitHub REST API either. However it is supported by via a couple (oh, the irony!) of GraphQL API queries:
query GetPullRequestID {
repository(name: "$repo", owner: "$owner") {
pullRequest(number: "$prnum") {
id
}
}
}
mutation EnableAutoMergeOnPullRequest {
enablePullRequestAutoMerge(input: {pullRequestId: "$pullRequestID", mergeMethod: MERGE}) {
clientMutationId
}
}
Rather than boiling the ocean by requesting general purpose public GraphQL support (#521), I wonder whether it might be acceptable to implement some low level GraphQL support that could be used internally to implement specific features not available in the REST API, such as enabling auto-merge on a PR. Perhaps in time this could become the basis for some general support but the immediate goal would be to enable access to APIs.