Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ Add them to the `ci-duty` team (`team-members/ci-duty.csv`). That team:
checks, and on `osac` it may also bypass the required reviews (`pull_request_bypassers`).
GitHub shows that checkbox only to someone who can bypass every rule on the branch. See
`repositories.tf`.
- Holds GitHub's predefined **App manager** organization role, so its members can register
and manage the GitHub Apps the organization owns (the OSAC CI app, for example). It does not
let them install or uninstall an app, or list one in the Marketplace: an organization owner
does that. See `organization.tf`.
- Has the `ci-maintainer` custom repository role on `osac` and `osac-test-infra`: write, plus
management of the repository's Actions secrets, variables, environments, settings and
runners, merge queue priority (jump the queue, solo merge), and bypass of branch
Expand Down
19 changes: 19 additions & 0 deletions organization.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ resource "github_organization_role_team" "cicd_admin_ci_duty" {
team_slug = github_team.all["ci-duty"].slug
}

# Assign GitHub's predefined "App manager" organization role to the ci-duty team,
# so it can register and manage the GitHub Apps owned by the organization (the OSAC
# CI app, for example) without being org owners. The role does not let them install
# or uninstall an app on the organization, or list an app in the Marketplace: an
# organization owner does that. Unlike the CI/CD admin role above, the API's name
# for this role is known: `gh api /orgs/osac-project/organization-roles` lists it
# as "app_manager" (source "Predefined").
locals {
app_manager_role_id = one([
for r in data.github_organization_roles.all.roles : r.role_id
if r.source == "Predefined" && r.name == "app_manager"
])
}

resource "github_organization_role_team" "app_manager_ci_duty" {
role_id = local.app_manager_role_id
team_slug = github_team.all["ci-duty"].slug
}

# Custom repository role for CI duty on the CI repositories (osac and
# osac-test-infra). The CI/CD admin role above covers only org-level Actions
# settings, so without this, repository secrets and variables (BUF_TOKEN,
Expand Down
Loading