X Tutup
Skip to content

Commit a4d1ce7

Browse files
committed
Fix fetching information about the PR potentially being behind base branch
1 parent 885e947 commit a4d1ce7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

api/queries_pr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ func pullRequestFragment(httpClient *http.Client, hostname string) (string, erro
533533

534534
fields := []string{
535535
"number", "title", "state", "url", "isDraft", "isCrossRepository",
536-
"headRefName", "headRepositoryOwner", "mergeStateStatus",
536+
"requiresStrictStatusChecks", "headRefName", "headRepositoryOwner", "mergeStateStatus",
537537
}
538538
if prFeatures.HasStatusCheckRollup {
539539
fields = append(fields, "statusCheckRollup")

api/query_builder.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ func PullRequestGraphQL(fields []string) string {
216216
q = append(q, `commits(last:1){nodes{commit{oid}}}`)
217217
case "commitsCount": // pseudo-field
218218
q = append(q, `commits{totalCount}`)
219+
case "requiresStrictStatusChecks": // pseudo-field
220+
q = append(q, `baseRef{branchProtectionRule{requiresStrictStatusChecks}}`)
219221
case "statusCheckRollup":
220222
q = append(q, StatusCheckRollupGraphQL(""))
221223
default:

0 commit comments

Comments
 (0)
X Tutup