Skip to content

refactor: improve get-repository-users-permission-and-source.sh output and usability#151

Merged
joshjohanning merged 5 commits intomainfrom
improve-user-and-permissions-source-script
Feb 25, 2026
Merged

refactor: improve get-repository-users-permission-and-source.sh output and usability#151
joshjohanning merged 5 commits intomainfrom
improve-user-and-permissions-source-script

Conversation

@joshjohanning
Copy link
Owner

  • 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
Copilot AI review requested due to automatic review settings February 25, 2026 20:54
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

📋 Lint Results

⚡ ./gh-cli scripts

✅ No issues found.

🔧 ./scripts scripts

✅ No issues found.

Lint results updated at Wed Feb 25 22:53:17 UTC 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --jq processing to format aligned USER | EFFECTIVE | SOURCES table 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.com and the API call doesn’t accept a --hostname. Many other scripts in gh-cli/ take an optional hostname (defaulting to github.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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@joshjohanning joshjohanning merged commit 0b8430c into main Feb 25, 2026
11 checks passed
@joshjohanning joshjohanning deleted the improve-user-and-permissions-source-script branch February 25, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants