From 430ed27a73ff7e69a3352f2686282a5217014ea4 Mon Sep 17 00:00:00 2001 From: Elior Erez Date: Wed, 9 Sep 2026 03:05:04 +0300 Subject: [PATCH] Fix CI/CD admin role lookup: use r.role_id, not r.id The apply workflow failed on main after the infrastructure-team change with: Error: Unsupported attribute on organization.tf, in locals: for r in data.github_organization_roles.all.roles : r.id This object does not have an attribute named "id". The github_organization_roles data source exposes the role identifier as role_id (the provider docs list an "id" too, but provider 6.12.1 does not emit it -- the role objects have 6 attributes and no "id"). Switch the projection back to r.role_id, matching how github_organization_role. runner_manager.role_id is already referenced elsewhere in this file. Note: if the next apply fails with one() getting 0 elements, the predefined role's name is none of the spellings in cicd_admin_role_names -- read the real value with an admin:org token (gh api /orgs/osac-project/organization-roles) or from Org Settings -> Organization roles, and pin role_id directly. Co-Authored-By: Claude Sonnet 5 --- organization.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/organization.tf b/organization.tf index d96a590..473e62c 100644 --- a/organization.tf +++ b/organization.tf @@ -44,7 +44,7 @@ locals { cicd_admin_role_names = ["CI/CD admin", "cicd_admin", "ci_cd_admin"] cicd_admin_role_id = one([ - for r in data.github_organization_roles.all.roles : r.id + for r in data.github_organization_roles.all.roles : r.role_id if r.source == "Predefined" && contains(local.cicd_admin_role_names, r.name) ]) }