feat: add Node.js version of add-codeowners-to-repositories#149
Merged
joshjohanning merged 3 commits intomainfrom Jan 30, 2026
Merged
feat: add Node.js version of add-codeowners-to-repositories#149joshjohanning merged 3 commits intomainfrom
joshjohanning merged 3 commits intomainfrom
Conversation
📋 Lint Results⚡ ./gh-cli scripts🔧 ./scripts scriptsLint results updated at Fri Jan 30 20:33:11 UTC 2026 |
Contributor
There was a problem hiding this comment.
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
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.
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