From 4323c2a7853534fbf6b09ad57f377e6cef61c40f Mon Sep 17 00:00:00 2001 From: Vedant Thapa <43611693+vedantthapa@users.noreply.github.com> Date: Tue, 7 Oct 2025 12:26:43 -0300 Subject: [PATCH 1/2] refactor: update actor_id to 0 Signed-off-by: Vedant Thapa <43611693+vedantthapa@users.noreply.github.com> --- modules/ruleset/repository_ruleset.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ruleset/repository_ruleset.tf b/modules/ruleset/repository_ruleset.tf index df2b436..b4c79c9 100644 --- a/modules/ruleset/repository_ruleset.tf +++ b/modules/ruleset/repository_ruleset.tf @@ -150,8 +150,8 @@ resource "github_repository_ruleset" "ruleset" { for_each = var.bypass_actors.organization_admin != null ? [1] : [] content { - # Docs suggest the ID can be fixed to 1 - https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_ruleset#OrganizationAdmin-1 - actor_id = 1 + # 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 + actor_id = 0 actor_type = "OrganizationAdmin" bypass_mode = coalesce(var.bypass_actors.organization_admin.always_bypass, false) ? "always" : "pull_request" } From d758b84f3c3aff7ef3180c888e0e8d06caf707ed Mon Sep 17 00:00:00 2001 From: vedantthapa Date: Tue, 7 Oct 2025 12:32:59 -0300 Subject: [PATCH 2/2] fix: update actor_id in organization ruleset and fix tests --- modules/ruleset/organization_ruleset.tf | 4 ++-- modules/ruleset/organization_ruleset.tftest.hcl | 2 +- modules/ruleset/repository_ruleset.tftest.hcl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ruleset/organization_ruleset.tf b/modules/ruleset/organization_ruleset.tf index 7e7bbb3..5910fb2 100644 --- a/modules/ruleset/organization_ruleset.tf +++ b/modules/ruleset/organization_ruleset.tf @@ -164,8 +164,8 @@ resource "github_organization_ruleset" "ruleset" { for_each = var.bypass_actors.organization_admin != null ? [1] : [] content { - # Docs suggest the ID can be fixed to 1 - https://registry.terraform.io/providers/integrations/github/latest/docs/resources/organization_ruleset#OrganizationAdmin-2 - actor_id = 1 + # 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 + actor_id = 0 actor_type = "OrganizationAdmin" bypass_mode = coalesce(var.bypass_actors.organization_admin.always_bypass, false) ? "always" : "pull_request" } diff --git a/modules/ruleset/organization_ruleset.tftest.hcl b/modules/ruleset/organization_ruleset.tftest.hcl index 549e728..51a3238 100644 --- a/modules/ruleset/organization_ruleset.tftest.hcl +++ b/modules/ruleset/organization_ruleset.tftest.hcl @@ -343,7 +343,7 @@ run "bypass_actor_integrations_test" { # Test the Organization Admin bypass actors run "bypass_actor_organization_admin_test" { assert { - condition = github_organization_ruleset.ruleset[0].bypass_actors[3].actor_id == 1 + condition = github_organization_ruleset.ruleset[0].bypass_actors[3].actor_id == 0 error_message = "The bypass actor organization admin id is incorrect." } assert { diff --git a/modules/ruleset/repository_ruleset.tftest.hcl b/modules/ruleset/repository_ruleset.tftest.hcl index ac454bf..9303c88 100644 --- a/modules/ruleset/repository_ruleset.tftest.hcl +++ b/modules/ruleset/repository_ruleset.tftest.hcl @@ -332,7 +332,7 @@ run "bypass_actor_integrations_test" { # Test the Organization Admin bypass actors run "bypass_actor_organization_admin_test" { assert { - condition = github_repository_ruleset.ruleset[0].bypass_actors[3].actor_id == 1 + condition = github_repository_ruleset.ruleset[0].bypass_actors[3].actor_id == 0 error_message = "The bypass actor organization admin id is incorrect." } assert {