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.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" } 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 {