Repo Maintain role can't bypass ruleset unless listed as actor
@kidskoding▲ 0 net votes
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.