You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation on well-known actor_id values? #4406
The ID of the actor that can bypass a ruleset. If actor_type is OrganizationAdmin, this should be 1. If actor_type is DeployKey, this should be null. OrganizationAdmin is not applicable for personal repositories.
That's a good and helpful start on known actor_id values. But there seem to be other well-known -or at least well-defined- values in play. For example, I've found across all repositories I've checked that the Repository admin role is 5.
Is there documentation somewhere on what those well-known actor_id values are? If not, could that be created please?
Context: this is useful for automating creation of branch rulesets. If someone wants to, say, create a standard branch protection for their default branch that exempts repo admins, they'll need to have the actor_id for bypass_actors. Pinging the GitHub API to fetch an ID that's always set to the same value would be extra complexity and time.
Reacted by derfryday, Steffen Anders, Patrick Roddy, Joel McCoy, Andrea Kaminski, Lindsay Thurmond, Stuart Purgavie, Viacheslav, scgcptigerhub, Anders R. Thorbeck and 3 more
It looks like even the documented behaviour has changed, for new rulesets created (and maybe modified) the ID returned for OrganizationAdmin is null (or 0 in Go/TF). You can still create the bypass rules with 1 but the result is null.
FYI the GH TF provider has the following repo role mappings.
maintain -> 2
write -> 4
admin -> 5
Reacted by Alan Christian, Andrea Kaminski, Stuart Purgavie, Alex Kelly and Aniruth
I ran into the same problem when managing repository rulesets using Terraform. My actors are set to OrganizationAdmin, and the actor ID is returned as 0, not 1 as documented.
Reacted by Albin Rönnkvist, Stuart Purgavie and Timo Sand
This was opened 2 years ago, how is it that I had to find out what id the maintain role is through this? Being able to configure "Bypass actors" is a security concern that shouldn't be able to change on a whim. This is the kind of thing that absolutely should be well-documented with a transition plan if you ever decide to change the contract.
Opened a follow-up with more detail on the security angle: #7111 — bypass_actors gates an actual security control (branch protection bypass), so an unpublished/drifting actor_id mapping isn't just an inconvenience, it's a silent misconfiguration risk.
If actor_type is OrganizationAdmin, actor_id is ignored.
I'm saying that I want people who have the "maintain" repository role to have the ability to approve of certain automated code reviews and if anyone else attempts to "resolve" them, a bot will undo the resolution.
The AI+documentation has provided me a working MVP of someone who is not an Admin tries to resolve, and a bot will re-open the code review issue. However when I resolve it with actor_id of 5, then it lets me through. Keep in mind I'm not an Organization Admin, just a volunteer on the team who has a vision that the Organization has a positive view on. Therefore, the OrganizationAdmin logic doesn't apply to me.
It turns out that in one of the repositories I'm not an Admin. I've been given Admin privileges to complete this, but we all agree that being able to assign a person a role of "Maintain" could be a good way to limit the security hole while expanding the number of people who can approve of PRs on this repository.
So the problem I'm facing is not about the OrganizationAdmin -- if I'm being honest, I probably shouldn't have even pointed out the "OrganizationAdmin's ID was already changed". That only diluted what I'm trying to say.
What I'm trying to say is: If you look at the documentation, you're supposed to put actor_id:
But the 5 predetermined roles are not custom, they're static. Read, Triage, Write, Maintain, Admin. If these are allowed as bypass actors, they should be somewhere accessible in the documentation. And evidence currently points to they are allowed. That's my point.
Activity
stevehipwell commentedon Jan 9, 2025
It looks like even the documented behaviour has changed, for new rulesets created (and maybe modified) the ID returned for
OrganizationAdminisnull(or0in Go/TF). You can still create the bypass rules with1but the result isnull.FYI the GH TF provider has the following repo role mappings.
maintain->2write->4admin->5jmehnle commentedon Jul 23, 2025
I ran into the same problem when managing repository rulesets using Terraform. My actors are set to
OrganizationAdmin, and the actor ID is returned as0, not1as documented.fix(recipe): detect RepositoryRole actor_id drift in repo-audit bypas…
docs(template): correct bypass actor role label (admin, not maintain)
docs(template): fix stale branch-protection ruleset + seed glossary (#…
ed-lichtman-nice commentedon Sep 1, 2026
This was opened 2 years ago, how is it that I had to find out what id the maintain role is through this? Being able to configure "Bypass actors" is a security concern that shouldn't be able to change on a whim. This is the kind of thing that absolutely should be well-documented with a transition plan if you ever decide to change the contract.
ed-lichtman-nice commentedon Sep 1, 2026
Opened a follow-up with more detail on the security angle: #7111 — bypass_actors gates an actual security control (branch protection bypass), so an unpublished/drifting actor_id mapping isn't just an inconvenience, it's a silent misconfiguration risk.
stevehipwell commentedon Sep 2, 2026
@ed-lichtman-nice the docs have been updated.
ed-lichtman-nice commentedon Sep 2, 2026
I'm saying that I want people who have the "maintain" repository role to have the ability to approve of certain automated code reviews and if anyone else attempts to "resolve" them, a bot will undo the resolution.
The AI+documentation has provided me a working MVP of someone who is not an Admin tries to resolve, and a bot will re-open the code review issue. However when I resolve it with actor_id of 5, then it lets me through. Keep in mind I'm not an Organization Admin, just a volunteer on the team who has a vision that the Organization has a positive view on. Therefore, the OrganizationAdmin logic doesn't apply to me.
It turns out that in one of the repositories I'm not an Admin. I've been given Admin privileges to complete this, but we all agree that being able to assign a person a role of "Maintain" could be a good way to limit the security hole while expanding the number of people who can approve of PRs on this repository.
So the problem I'm facing is not about the OrganizationAdmin -- if I'm being honest, I probably shouldn't have even pointed out the "OrganizationAdmin's ID was already changed". That only diluted what I'm trying to say.
What I'm trying to say is: If you look at the documentation, you're supposed to put actor_id:
https://docs.github.com/en/rest/repos/rules?apiVersion=2026-03-10&versionId=free-pro-team%40latest&productId=rest#update-a-repository-ruleset
But nowhere in the documentation can I find what the actor_id values are.
I saw one page with custom repository roles:
Repository Roles)
and the List custom repository roles in an organization:
Rest Endpoint to list custom roles
But the 5 predetermined roles are not custom, they're static. Read, Triage, Write, Maintain, Admin. If these are allowed as bypass actors, they should be somewhere accessible in the documentation. And evidence currently points to they are allowed. That's my point.
provisioner: declared bypass_actors + enforcement (anti-lockout); pro…