Skip to content

Commit

Permalink
Merge pull request #258 from garethjevans/capture-branch-protection
Browse files Browse the repository at this point in the history
chore: capture branch protection rules
  • Loading branch information
garethjevans authored Nov 20, 2022
2 parents b0160de + 0c4bc01 commit e1b788c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/cmd/common_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ func TestCommonCmd_Filter_AllData(t *testing.T) {
"author": {
"login": "author1"
},
"baseRef": {
"branchProtectionRule": {
"requiredStatusCheckContexts": null
}
},
"closed": false,
"comments": {
"totalCount": 0
Expand All @@ -47,6 +52,11 @@ func TestCommonCmd_Filter_AllData(t *testing.T) {
"author": {
"login": "author2"
},
"baseRef": {
"branchProtectionRule": {
"requiredStatusCheckContexts": null
}
},
"closed": false,
"comments": {
"totalCount": 0
Expand All @@ -71,6 +81,11 @@ func TestCommonCmd_Filter_AllData(t *testing.T) {
"author": {
"login": "author3"
},
"baseRef": {
"branchProtectionRule": {
"requiredStatusCheckContexts": null
}
},
"closed": false,
"comments": {
"totalCount": 0
Expand Down Expand Up @@ -110,6 +125,11 @@ func TestCommonCmd_Filter_FilterOnAuthor(t *testing.T) {
"author": {
"login": "author1"
},
"baseRef": {
"branchProtectionRule": {
"requiredStatusCheckContexts": null
}
},
"closed": false,
"comments": {
"totalCount": 0
Expand Down
5 changes: 5 additions & 0 deletions pkg/domain/get_prs.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ var (
}
}
}
baseRef {
branchProtectionRule {
requiredStatusCheckContexts
}
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/pr/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ type PullRequest struct {
Repository Repository `json:"repository"`
Comments Comments `json:"comments"`
ReviewDecision string `json:"reviewDecision"`
BaseRef BaseRef `json:"baseRef"`
}

type BaseRef struct {
BranchProtectionRule BranchProtectionRule `json:"branchProtectionRule"`
}

type BranchProtectionRule struct {
RequiredStatusCheckContexts []string `json:"requiredStatusCheckContexts"`
}

const (
Expand Down

0 comments on commit e1b788c

Please sign in to comment.