Fix fetching information about the PR potentially being behind base branch

This commit is contained in:
Mislav Marohnić 2021-06-10 15:51:27 +02:00
parent 885e94786a
commit a4d1ce7709
2 changed files with 3 additions and 1 deletions

View file

@ -533,7 +533,7 @@ func pullRequestFragment(httpClient *http.Client, hostname string) (string, erro
fields := []string{
"number", "title", "state", "url", "isDraft", "isCrossRepository",
"headRefName", "headRepositoryOwner", "mergeStateStatus",
"requiresStrictStatusChecks", "headRefName", "headRepositoryOwner", "mergeStateStatus",
}
if prFeatures.HasStatusCheckRollup {
fields = append(fields, "statusCheckRollup")

View file

@ -216,6 +216,8 @@ func PullRequestGraphQL(fields []string) string {
q = append(q, `commits(last:1){nodes{commit{oid}}}`)
case "commitsCount": // pseudo-field
q = append(q, `commits{totalCount}`)
case "requiresStrictStatusChecks": // pseudo-field
q = append(q, `baseRef{branchProtectionRule{requiresStrictStatusChecks}}`)
case "statusCheckRollup":
q = append(q, StatusCheckRollupGraphQL(""))
default: