Ruleset bypass_actors: base repository role names resolve to the wrong ids
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript, node.js
Research direction
Start with lib/plugins/rulesets.js and inspect BASE_REPOSITORY_ROLE_IDS and the code that handles RepositoryRole bypass actors. Confirm the repository role IDs against the issue's GraphQL reproduction details, then check nearby tests for role mapping and invalid roles. Done means the supported names resolve to the reported IDs and read and triage produce a clear error.
Written by the indexing model from the issue text.
Description
Problem
BASE_REPOSITORY_ROLE_IDS in lib/plugins/rulesets.js (added in #990) maps read: 1, triage: 2, write: 3, maintain: 4, admin: 5. GitHub uses maintain: 2, write: 4, admin: 5, so only admin resolves correctly:
name: maintainresolves to 4, so everyone withwritegets the bypass.name: writeresolves to 3, and GitHub rejects the ruleset:422 Actor base role does not have write permissions.name: triageresolves to 2, somaintaingets the bypass.
Reproduce
Create a repository ruleset with RepositoryRole bypass actors with ids 2, 4, and 5, then read them back through GraphQL (bypassActors { repositoryRoleName repositoryRoleDatabaseId }): 2 = maintain, 4 = write, 5 = admin. Ids 1 and 3 fail with the 422 above. The Terraform provider docs list the same ids.
Suggested fix
Map maintain: 2, write: 4, admin: 5, and reject read and triage with a clear error, since GitHub doesn't allow them as bypass actors.
- Dominant language
- JavaScript
- Stars
- 942
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github-community-projects/safe-settings
-
Teams: teams with organization-role access show up as deletionsPossibly taken @TovaBecker claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
github-community-projects/safe-settings#1144 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github-community-projects/safe-settings#1135 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github-community-projects/safe-settings#1134 ·
Maintainers usually reply within 2 days
-
environments: additive_plugins is ignored, undeclared environments are deletedPossibly taken @yaunj claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github-community-projects/safe-settings#1133 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
github-community-projects/safe-settings#1130 ·
Maintainers usually reply within 2 days
All issues in github-community-projects/safe-settings
Similar issues
-
area:webapp bug finding
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
humlab-sead/sead_shape_shifter#779 ·
Maintainers usually reply within 1 day
-
enhancement feature/llm-analytics
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PostHog/posthog#139959 · 1 comment ·
Maintainers usually reply within 1 day
-
ci good first issue priority:p1
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mobeloper/better-oss#23 ·
-
accessibility Could Have good first issue seo
Difficulty 1/5 Under an hour Newbie friendliness 88/100
hannahro15/Musical-Match-Saga#278 ·
Maintainers usually reply within 1 day