Skip to content

Commit 46253c6

Browse files
committed
feat: all-repository ruleset bypass actors
1 parent 14e62cf commit 46253c6

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,14 @@ organization:
176176
- name: "Main Branch"
177177
target: branch # REQUIRED, VALUES branch or tag
178178
enforcement: active # REQUIRED, VALUES disabled or active
179+
bypass_actors: # OPTIONAL, DEFAULT empty
180+
# Xebis GitHub Semantic Release https://github.com/apps/xebis-github-semantic-release
181+
- actor_id: 1527160 # REQUIRED, VALUE The ID of the actor
182+
actor_type: Integration # REQUIRED, VALUES RepositoryRole, Team, Integration, OR OrganizationAdmin
183+
bypass_mode: always # REQUIRED, VALUES always or pull_request
179184
conditions: # OPTIONAL, DEFAULT empty
180185
ref_name:
181-
include: # OPTIONAL, DEFAULT empty, VALUE array of ref names or patterns to include, special values ~ALL and ~DEFAULT_BRANCH also accepted
186+
include: # OPTIONAL, DEFAULT empty, VALUE array of ref names or patterns to include, SPECIAL VALUES ~ALL and ~DEFAULT_BRANCH also accepted
182187
- ~DEFAULT_BRANCH
183188
exclude: # OPTIONAL, DEFAULT empty
184189
rules:

terraform/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ resource "github_repository_ruleset" "all_repositories" {
4949
target = try(each.value.ruleset.target, null)
5050
enforcement = try(each.value.ruleset.enforcement, null)
5151

52+
# Bypass actors
53+
dynamic "bypass_actors" {
54+
for_each = try(each.value.ruleset.bypass_actors, [])
55+
content {
56+
actor_id = bypass_actors.value.actor_id
57+
actor_type = bypass_actors.value.actor_type
58+
bypass_mode = bypass_actors.value.bypass_mode
59+
}
60+
}
61+
5262
# Conditions
5363
dynamic "conditions" {
5464
for_each = try(length(each.value.ruleset.conditions) > 0 ? [each.value.ruleset.conditions] : [], [])

test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ organization:
88
- name: "Main Branch"
99
target: branch
1010
enforcement: active
11+
bypass_actors:
12+
# Xebis GitHub Semantic Release https://github.com/apps/xebis-github-semantic-release
13+
- actor_id: 1527160
14+
actor_type: Integration
15+
bypass_mode: always
1116
conditions:
1217
ref_name:
1318
include:

0 commit comments

Comments
 (0)