Skip to content

Documentation on well-known actor_id values? #4406

Open

Description

@JoshuaKGoldberg

Coming over from https://docs.github.com/en/rest/repos/rules?apiVersion=2022-11-28#create-a-repository-ruleset--fine-grained-access-tokens > bypass_actors > actor_id:

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.

Activity

  1. stevehipwell commented on Jan 9, 2025

    @stevehipwell

    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
  2. jmehnle commented on Jul 23, 2025

    @jmehnle

    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.

  3. ed-lichtman-nice commented on Sep 1, 2026

    @ed-lichtman-nice

    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.

  4. ed-lichtman-nice commented on Sep 1, 2026

    @ed-lichtman-nice

    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.

  5. stevehipwell commented on Sep 2, 2026

    @stevehipwell

    @ed-lichtman-nice the docs have been updated.

    If actor_type is OrganizationAdmin, actor_id is ignored.

  6. ed-lichtman-nice commented on Sep 2, 2026

    @ed-lichtman-nice

    @ed-lichtman-nice the docs have been updated.

    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:

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions