Add PR auto-merge status info to PR queries (#7384)

This commit is contained in:
Martijn Pieters 2023-05-03 22:36:21 +01:00 committed by GitHub
parent d349ba185a
commit bf3ffba8ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View file

@ -132,6 +132,17 @@ var prCommits = shortenQuery(`
}
`)
var autoMergeRequest = shortenQuery(`
autoMergeRequest {
authorEmail,
commitBody,
commitHeadline,
mergeMethod,
enabledAt,
enabledBy{login,...on User{id,name}}
}
`)
func StatusCheckRollupGraphQL(after string) string {
var afterClause string
if after != "" {
@ -231,6 +242,7 @@ var IssueFields = []string{
var PullRequestFields = append(IssueFields,
"additions",
"autoMergeRequest",
"baseRefName",
"changedFiles",
"commits",
@ -285,6 +297,8 @@ func IssueGraphQL(fields []string) string {
q = append(q, `mergeCommit{oid}`)
case "potentialMergeCommit":
q = append(q, `potentialMergeCommit{oid}`)
case "autoMergeRequest":
q = append(q, autoMergeRequest)
case "comments":
q = append(q, issueComments)
case "lastComment": // pseudo-field