feat: add per-permission-level repo exclusions to github-add-repo-permissions#48
Merged
Merged
Conversation
…missions Add REPO_ADMIN_EXCLUDE, REPO_MAINTAIN_EXCLUDE, REPO_PUSH_EXCLUDE, REPO_TRIAGE_EXCLUDE, and REPO_PULL_EXCLUDE variables to skip named repos for a given permission level only. Expose them as action.yml inputs, document in README, and add behavioral tests with a dedicated curl mock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds per-permission-level repository exclusion support to
github-add-repo-permissions. Previously the script applied each configured permission level to every repo in the org (optionally prefix-filtered). Now each level can skip a specific set of repositories.Changes
REPO_ADMIN_EXCLUDE,REPO_MAINTAIN_EXCLUDE,REPO_PUSH_EXCLUDE,REPO_TRIAGE_EXCLUDE,REPO_PULL_EXCLUDE. Each is a space-separated list of exact repo names skipped for that permission level only. Newis_excludedandapply_levelhelpers handle the logic and emit aSkipping <level> on <repo> (excluded)message.repo-*-excludeinputs with env mappings.tests/mock_curl_permissions.sh.Motivation
Allows granting broad team access while carving out sensitive repositories from a specific level (e.g., exclude certain repos from a read-only/pull team) without splitting runs or maintaining separate configs.
Testing
shellcheckclean on the modified script and new mock.bats tests/— full suite passes (101 tests), including the 5 tests for this script.Usage example