Merge pull request #3922 from cli/fix-branch-protection

Fix bug where branchProtectionRule doesn't exist in enterprise 2.22
This commit is contained in:
Nate Smith 2021-06-30 15:46:33 -07:00 committed by GitHub
commit 717c91c912
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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