NX Plugin to generate CODEOWNERS file for GITHUB
@swapniltech0390/nx-codeowners:codeowners
This library can be used to generate CODEOWNERS file for NX projects on GITHUB.
Executor
1 Install pacakge
npm i @swapniltech0390/nx-codeowners
2 Add in root project.json
Properties to be added in executor
- coreReviewers : Default set of core reviewers if reviewer missing in project json.
- sources : List of path to iterate through and find all application and libraries inside these folder to set reviewe in CODEOWNERS.
"codeowners": {
"executor": "@swapniltech0390/nx-codeowners:codeowners",
"options": {
"coreReviewers": [
"@github_id","@github_id" // List of Github ID for review of application or library
],
"sources": ["apps","libs"] // List of path where application / Libraries are placed from root
}
}
3 Add reviewers in project.json for Application or Libraries
NOTE reviewers should be valid github user ID or Group Name
{
"name": "appName",
// ...
"tags": [],
"reviewers": [
"@github_id","@github_id" // List of Github ID for review of application / library
]
}
4 Run the executor from root to generate CODEOWNERS
nx run <ProjectName>:codeowners
Output :
New CODEOWNERS file generated at root with reviewers mapping for respective applications & libraries