From 6bfca3f839cd26da39299e023499ce873a8563c5 Mon Sep 17 00:00:00 2001 From: Clemens W Date: Thu, 18 Sep 2025 14:38:54 +0200 Subject: [PATCH 1/2] add exempt as bypass mode to ruleset bypass actors --- github/orgs_rules_test.go | 15 +++++++++++++++ github/rules.go | 1 + 2 files changed, 16 insertions(+) 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..5f9f8e7aaa6 100644 --- a/github/rules.go +++ b/github/rules.go @@ -59,6 +59,7 @@ type BypassMode string const ( BypassModeAlways BypassMode = "always" BypassModePullRequest BypassMode = "pull_request" + BypassModeExempt BypassMode = "exempt" BypassModeNever BypassMode = "never" ) From 484d81c92d016a528ba38cc4002ad0192fa58ff8 Mon Sep 17 00:00:00 2001 From: Clemens W Date: Fri, 19 Sep 2025 09:37:57 +0200 Subject: [PATCH 2/2] sorted list of bypass modes --- github/rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/rules.go b/github/rules.go index 5f9f8e7aaa6..7b474f00e68 100644 --- a/github/rules.go +++ b/github/rules.go @@ -58,9 +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.