Add bypass_actors support to GitHub rulesets #129

Merged
benvin merged 2 commits from benvin/ruleset-bypass-actors into main 2026-11-18 22:56:35 +11:00
Member

Rulesets cannot name bypass actors, so a rule like tag creation can only be enforced for everyone, admins and maintainers included.

  • add optional bypass_actors to ruleset YAML (actor_type, actor_id or team, bypass_mode defaulting to always)
  • resolve team to the id of a team managed under team/
  • validate actor_type and bypass_mode against the provider values, team set exactly for Team actors and known, actor_id required for RepositoryRole/Integration/User and rejected otherwise
  • expose the team id from the team module
  • default to no bypass actors, leaving existing rulesets unchanged
Rulesets cannot name bypass actors, so a rule like tag creation can only be enforced for everyone, admins and maintainers included. - add optional `bypass_actors` to ruleset YAML (`actor_type`, `actor_id` or `team`, `bypass_mode` defaulting to `always`) - resolve `team` to the id of a team managed under `team/` - validate `actor_type` and `bypass_mode` against the provider values, `team` set exactly for `Team` actors and known, `actor_id` required for `RepositoryRole`/`Integration`/`User` and rejected otherwise - expose the team id from the team module - default to no bypass actors, leaving existing rulesets unchanged
unkin-agent added 1 commit 2026-11-17 23:41:02 +11:00
Add bypass_actors support to GitHub rulesets
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
6ab490c23c
Author
Member
  • modules/github_org/variables.tf:63 — no check that actor_id is set for RepositoryRole/Integration/User/Team-less id-bearing actors (provider 6.13.0: actor_id optional, must be omitted only for OrganizationAdmin/EnterpriseOwner/DeployKey); a missing id fails at apply with a GitHub 422 → add a validation requiring actor_id != null for those types.
  • nit: modules/github_org/variables.tf:29 — actor_type/bypass_mode are free strings, typos surface only at apply → validate against Integration|OrganizationAdmin|RepositoryRole|Team|DeployKey|EnterpriseOwner|User and always|pull_request|exempt.
  • nit: modules/github_org/variables.tf:63 — Team with both team and actor_id silently drops actor_id → reject.
- modules/github_org/variables.tf:63 — no check that `actor_id` is set for `RepositoryRole`/`Integration`/`User`/`Team`-less id-bearing actors (provider 6.13.0: actor_id optional, must be omitted only for `OrganizationAdmin`/`EnterpriseOwner`/`DeployKey`); a missing id fails at apply with a GitHub 422 → add a validation requiring `actor_id != null` for those types. - nit: modules/github_org/variables.tf:29 — `actor_type`/`bypass_mode` are free strings, typos surface only at apply → validate against `Integration|OrganizationAdmin|RepositoryRole|Team|DeployKey|EnterpriseOwner|User` and `always|pull_request|exempt`. - nit: modules/github_org/variables.tf:63 — `Team` with both `team` and `actor_id` silently drops `actor_id` → reject.
unkin-agent added 1 commit 2026-11-17 23:50:20 +11:00
Validate bypass_actors actor_type, bypass_mode and actor_id
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful
04bc546e15
Allowed values from integrations/github 6.13.0 github_repository_ruleset:
actor_id is required for RepositoryRole, Integration and User and rejected
for Team (resolved from team), OrganizationAdmin, EnterpriseOwner and
DeployKey.
Author
Member

No findings.

No findings.
benvin merged commit 8c07fb92d0 into main 2026-11-18 22:56:35 +11:00
benvin deleted branch benvin/ruleset-bypass-actors 2026-11-18 22:56:35 +11:00
This repo is archived. You cannot comment on pull requests.