Code owners
Use code owners to define individuals or teams that are responsible for code in your monorepo and integrate with your git hosting provider’s CODEOWNERS implementation.
Getting started
Section titled Getting startedSet your codeowners provider in your root configuration file:
export default { core: { codeowners: { provider: 'github', }, },};Add codeowners to any Workspace or root configuration:
export default { codeowners: { '*': ['@my-team', '@person'], scripts: ['@infra-team'], },};Run the sync command to update any time you make changes to code owners:
one codeowners syncHosting providers
Section titled Hosting providersThe following providers are currently enabled:
Commands
Section titled Commandsone codeowners
Section titled one codeownersAliases: one owners
Manage codeowners
one codeowners <command>one codeowners show
Section titled one codeowners showShow the code owners for files and Workspaces.
one codeowners show [options]| Option | Type | Description |
|---|---|---|
--affected | boolean | Select all affected Workspaces. If no other inputs are chosen, this will default to true. |
--all, -a | boolean | Run across all Workspaces |
--files, -f | array | Determine Workspaces from specific files |
--format | "plain", "json", default: "plain" | Choose how the results will be returned. |
--list | boolean | Just list the owners without the files |
--staged | boolean | Use files on the git stage to calculate affected files or Workspaces. When unset or --no-staged, changes will be calculated from the entire branch, since its fork point. |
--workspaces, -w | array | List of Workspace names to run against |
Advanced options
| Option | Type | Description | Required |
|---|---|---|---|
--from-ref | string | Git ref to start looking for affected files or Workspaces | |
--provider | "github", "gitlab", "gitea", "bitbucket" | Codeowner provider determines where the CODEOWNERS file(s) will be written. | ✅ |
--through-ref | string | Git ref to start looking for affected files or Workspaces |
Show the codeowners for currently modified files.
one codeowners showList the unique set of codeowners given an input workspace-name.
one codeowners show --list -w <workspace-name>one codeowners sync
Section titled one codeowners syncSync code owners from Workspace configurations to the repository’s CODEOWNERS file.
one codeowners syncThis command will sync each Workspace’s codeowners to the repository’s configured vcs.provider compatible code owners file.
- github:
.github/CODEOWNERS - gitlab:
.gitlab/CODEOWNERS - gitea:
.gitea/CODEOWNERS - bitbucket:
CODEOWNERS
| Option | Type | Description |
|---|---|---|
--add | boolean | Add the updated CODEOWNERS file to the git stage. |
Advanced options
| Option | Type | Description | Required |
|---|---|---|---|
--provider | "github", "gitlab", "gitea", "bitbucket" | Codeowner provider determines where the CODEOWNERS file(s) will be written. | ✅ |
one codeowners verify
Section titled one codeowners verifyVerify the CODEOWNERS file is up to date and unmodified.
one codeowners verifyAdvanced options
| Option | Type | Description | Required |
|---|---|---|---|
--provider | "github", "gitlab", "gitea", "bitbucket" | Codeowner provider determines where the CODEOWNERS file(s) will be written. | ✅ |