-
Notifications
You must be signed in to change notification settings - Fork 61
feat: add Node.js version of add-codeowners-to-repositories #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📋 Lint Results⚡ ./gh-cli scripts🔧 ./scripts scriptsLint results updated at Fri Jan 30 20:33:11 UTC 2026 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a Node.js implementation of a CODEOWNERS file management script along with two bash scripts for comparing package.json contents across repositories.
Changes:
- New
scripts/add-codeowners-to-repositories/directory containing a Node.js script for managing CODEOWNERS files with features like concurrency control, dry-run mode, and retry logic - Two new bash scripts in
gh-cli/for comparing package.json scripts and devDependencies across multiple repositories - Updated
gh-cli/README.mdwith entries for the two new comparison scripts
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/add-codeowners-to-repositories/package.json | Defines dependencies and metadata for the Node.js CODEOWNERS management script |
| scripts/add-codeowners-to-repositories/add-codeowners-to-repositories.js | Main Node.js script implementing CODEOWNERS file management with append/overwrite modes, concurrency control, and retry logic |
| scripts/add-codeowners-to-repositories/README.md | Documentation for the CODEOWNERS management script including usage, options, and examples |
| gh-cli/compare-package-scripts-across-repositories.sh | Bash script to compare package.json scripts across repositories to identify differences |
| gh-cli/compare-dev-dependencies-across-repositories.sh | Bash script to compare devDependencies in package.json across repositories with version mismatch detection |
| gh-cli/README.md | Updates to document the two new comparison scripts in alphabetical order |
Comments suppressed due to low confidence (1)
scripts/add-codeowners-to-repositories/add-codeowners-to-repositories.js:311
- The
defaultBranchvariable is retrieved but never used in the function. This variable retrieval adds an unnecessary API call. Consider removing the call togetDefaultBranchif the default branch information is not needed, or use it if there's a specific reason (e.g., to validate the repository or include it in logging/reporting).
const defaultBranch = await getDefaultBranch(octokit, org, repo);
0169a12 to
a94ad2a
Compare
There was a problem hiding this 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 4 out of 4 changed files in this pull request and generated 1 comment.
Adds a Node.js implementation of the CODEOWNERS file management script with improved capabilities.
Changes
scripts/add-codeowners-to-repositories/directory with Node.js solutionFeatures
.github/,docs/)GITHUB_API_URLUsage
cd scripts/add-codeowners-to-repositories npm install node add-codeowners-to-repositories.js --repos-file repos.txt --codeowners ./CODEOWNERS