Skip to content

Commit 929058e

Browse files
authored
Add exempt as bypass mode to ruleset bypass actors (#3719)
1 parent 852eb06 commit 929058e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

github/orgs_rules_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) {
130130
{
131131
"actor_id": 234,
132132
"actor_type": "Team"
133+
},
134+
{
135+
"actor_id": 345,
136+
"actor_type": "Team",
137+
"bypass_mode": "exempt"
133138
}
134139
],
135140
"conditions": {
@@ -274,6 +279,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) {
274279
ActorID: Ptr(int64(234)),
275280
ActorType: Ptr(BypassActorTypeTeam),
276281
},
282+
{
283+
ActorID: Ptr(int64(345)),
284+
ActorType: Ptr(BypassActorTypeTeam),
285+
BypassMode: Ptr(BypassModeExempt),
286+
},
277287
},
278288
Conditions: &RepositoryRulesetConditions{
279289
RefName: &RepositoryRulesetRefConditionParameters{
@@ -371,6 +381,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) {
371381
ActorID: Ptr(int64(234)),
372382
ActorType: Ptr(BypassActorTypeTeam),
373383
},
384+
{
385+
ActorID: Ptr(int64(345)),
386+
ActorType: Ptr(BypassActorTypeTeam),
387+
BypassMode: Ptr(BypassModeExempt),
388+
},
374389
},
375390
Conditions: &RepositoryRulesetConditions{
376391
RefName: &RepositoryRulesetRefConditionParameters{

github/rules.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ type BypassMode string
5858
// This is the set of GitHub ruleset bypass modes.
5959
const (
6060
BypassModeAlways BypassMode = "always"
61-
BypassModePullRequest BypassMode = "pull_request"
61+
BypassModeExempt BypassMode = "exempt"
6262
BypassModeNever BypassMode = "never"
63+
BypassModePullRequest BypassMode = "pull_request"
6364
)
6465

6566
// RepositoryRuleType represents a GitHub ruleset rule type.

0 commit comments

Comments
 (0)