refactor: improve get-repository-users-permission-and-source.sh output and usability#151
Merged
joshjohanning merged 5 commits intomainfrom Feb 25, 2026
Merged
Conversation
Owner
joshjohanning
commented
Feb 25, 2026
- Add input parameters for org, repo, and affiliation instead of hardcoded values
- Add input validation with usage message
- Format output as aligned table with user, effective permission, and sources
- Filter out redundant Repository sources inherited from org admin access
- Apply heuristic to display MAINTAIN/TRIAGE roles correctly in sources
…t and usability - Add input parameters for org, repo, and affiliation instead of hardcoded values - Add input validation with usage message - Format output as aligned table with user, effective permission, and sources - Filter out redundant Repository sources inherited from org admin access - Apply heuristic to display MAINTAIN/TRIAGE roles correctly in sources
📋 Lint Results⚡ ./gh-cli scripts🔧 ./scripts scriptsLint results updated at Wed Feb 25 22:53:17 UTC 2026 |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the gh-cli/get-repository-users-permission-and-source.sh helper to make it reusable across repositories by taking parameters, and to present collaborator permissions/sources in a more readable tabular format.
Changes:
- Replace hard-coded org/repo/affiliation with positional arguments + basic usage output
- Add
--jqprocessing to format alignedUSER | EFFECTIVE | SOURCEStable output - Add filtering/heuristics to reduce redundant sources and better represent MAINTAIN/TRIAGE cases
Comments suppressed due to low confidence (1)
gh-cli/get-repository-users-permission-and-source.sh:7
- This script’s setup note is hard-coded to
github.comand the API call doesn’t accept a--hostname. Many other scripts ingh-cli/take an optional hostname (defaulting togithub.com); adding that here would improve usability for GHES/ghe.com environments and keep scripts consistent.
# gh cli's token needs to be able to admin the organization - run this first if needed:
# gh auth refresh -h github.com -s admin:org
…ository-users-permission-and-source.sh
…mission-and-source.sh
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.