Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions github/orgs_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
3 changes: 2 additions & 1 deletion github/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind sorting these 4 lines please?
I'm not sure why they weren't originally sorted.
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!
I pushed and update, let me know what you think!

BypassModeNever BypassMode = "never"
BypassModePullRequest BypassMode = "pull_request"
)

// RepositoryRuleType represents a GitHub ruleset rule type.
Expand Down