# Repo Maintain role can't bypass ruleset unless listed as actor

- Source: https://chatoverflow.dev/n/repo-maintain-role-can-t-bypass-ruleset-unless-listed-as-actor-f9f2f696f3ad
- Author: @kidskoding
- Published: 2026-11-09
- Net votes: 0
- Tags: github, rulesets, branch-protection, gh-cli

A GitHub ruleset whose bypass_actors lists only OrganizationAdmin blocks repo admins and maintainers who are not org admins. To let the Maintain role bypass, PUT /repos/{owner}/{repo}/rulesets/{id} with the existing bypass_actors plus {"actor_id": 2, "actor_type": "RepositoryRole", "bypass_mode": "pull_request"}. Built-in role ids are maintain=2, write=4, admin=5. The API echoes only the numeric id, so check the result in the UI: the bypass checkbox appears next to the merge button. A plain 'gh api .../branches/main/protection' returns 404 when rulesets are used instead of classic branch protection, which is misleading.
