Skip to content

Commit fb070d3

Browse files
authored
refactor: update actor_id to 0 (#67)
* refactor: update actor_id to 0 Signed-off-by: Vedant Thapa <43611693+vedantthapa@users.noreply.github.com> * fix: update actor_id in organization ruleset and fix tests --------- Signed-off-by: Vedant Thapa <43611693+vedantthapa@users.noreply.github.com>
1 parent d5c1a82 commit fb070d3

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

modules/ruleset/organization_ruleset.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ resource "github_organization_ruleset" "ruleset" {
164164
for_each = var.bypass_actors.organization_admin != null ? [1] : []
165165

166166
content {
167-
# Docs suggest the ID can be fixed to 1 - https://registry.terraform.io/providers/integrations/github/latest/docs/resources/organization_ruleset#OrganizationAdmin-2
168-
actor_id = 1
167+
# Although provider docs suggest the ID can be fixed to 1, it has been recently changed to 0 - https://github.com/integrations/terraform-provider-github/issues/2536
168+
actor_id = 0
169169
actor_type = "OrganizationAdmin"
170170
bypass_mode = coalesce(var.bypass_actors.organization_admin.always_bypass, false) ? "always" : "pull_request"
171171
}

modules/ruleset/organization_ruleset.tftest.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ run "bypass_actor_integrations_test" {
343343
# Test the Organization Admin bypass actors
344344
run "bypass_actor_organization_admin_test" {
345345
assert {
346-
condition = github_organization_ruleset.ruleset[0].bypass_actors[3].actor_id == 1
346+
condition = github_organization_ruleset.ruleset[0].bypass_actors[3].actor_id == 0
347347
error_message = "The bypass actor organization admin id is incorrect."
348348
}
349349
assert {

modules/ruleset/repository_ruleset.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ resource "github_repository_ruleset" "ruleset" {
150150
for_each = var.bypass_actors.organization_admin != null ? [1] : []
151151

152152
content {
153-
# Docs suggest the ID can be fixed to 1 - https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_ruleset#OrganizationAdmin-1
154-
actor_id = 1
153+
# Although provider docs suggest the ID can be fixed to 1, it has been recently changed to 0 - https://github.com/integrations/terraform-provider-github/issues/2536
154+
actor_id = 0
155155
actor_type = "OrganizationAdmin"
156156
bypass_mode = coalesce(var.bypass_actors.organization_admin.always_bypass, false) ? "always" : "pull_request"
157157
}

modules/ruleset/repository_ruleset.tftest.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ run "bypass_actor_integrations_test" {
332332
# Test the Organization Admin bypass actors
333333
run "bypass_actor_organization_admin_test" {
334334
assert {
335-
condition = github_repository_ruleset.ruleset[0].bypass_actors[3].actor_id == 1
335+
condition = github_repository_ruleset.ruleset[0].bypass_actors[3].actor_id == 0
336336
error_message = "The bypass actor organization admin id is incorrect."
337337
}
338338
assert {

0 commit comments

Comments
 (0)