diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index d9727fff89a..10e379e02a7 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -130,6 +130,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { { "actor_id": 234, "actor_type": "Team" + }, + { + "actor_id": 345, + "actor_type": "Team", + "bypass_mode": "exempt" } ], "conditions": { @@ -274,6 +279,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { ActorID: Ptr(int64(234)), ActorType: Ptr(BypassActorTypeTeam), }, + { + ActorID: Ptr(int64(345)), + ActorType: Ptr(BypassActorTypeTeam), + BypassMode: Ptr(BypassModeExempt), + }, }, Conditions: &RepositoryRulesetConditions{ RefName: &RepositoryRulesetRefConditionParameters{ @@ -371,6 +381,11 @@ func TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) { ActorID: Ptr(int64(234)), ActorType: Ptr(BypassActorTypeTeam), }, + { + ActorID: Ptr(int64(345)), + ActorType: Ptr(BypassActorTypeTeam), + BypassMode: Ptr(BypassModeExempt), + }, }, Conditions: &RepositoryRulesetConditions{ RefName: &RepositoryRulesetRefConditionParameters{ diff --git a/github/rules.go b/github/rules.go index 4def2d19ee4..7b474f00e68 100644 --- a/github/rules.go +++ b/github/rules.go @@ -58,8 +58,9 @@ type BypassMode string // This is the set of GitHub ruleset bypass modes. const ( BypassModeAlways BypassMode = "always" - BypassModePullRequest BypassMode = "pull_request" + BypassModeExempt BypassMode = "exempt" BypassModeNever BypassMode = "never" + BypassModePullRequest BypassMode = "pull_request" ) // RepositoryRuleType represents a GitHub ruleset rule type.