gh-codeowners

command module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

CODEOWNERS GitHub CLI extension

releases ci

Lint your CODEOWNERS file.

Install

Make sure you have version 2.0 or newer of the GitHub CLI installed.

gh extension install heaths/gh-codeowners
Upgrade

The gh extension list command shows if updates are available for extensions. To upgrade, you can use the gh extension upgrade command:

gh extension upgrade heaths/gh-codeowners

# Or upgrade all extensions:
gh extension upgrade --all

When used in Continuous Integration, starting with gh version 2.25.0, you can install or upgrade the extension with a single command:

gh extension install --force heaths/gh-codeowners

Usage

Lint

Render a list of errors based on the current branch's CODEOWNERS errors reported by GitHub:

gh codeowners lint

You can also get a sorted list of unknown owners or just return the raw JSON:

gh codeowners lint --json
gh codeowners lint --unknown-owners
PR

To see the codeowners for each file in a pull request:

gh codeowners pr 123

The output is rendered as colorful, formatted JSON in terminals but will be compact JSON when piped to another program like jq:

# Check for added files.
gh codeowners pr 123 | jq '.[] | select(.changeType=="ADDED")'
View

To render your CODEOWNERS file with errors reported by GitHub:

gh codeowners view

screenshot

Configuration

This extension will render colors whenever possible and, in some scenarios like when printing a list of errors, maybe change the format to prefer colors over markers that may work better only for non-colored text.

You can override these colors on the command line (pass --help for details) or permanently with a configuration file located under your home directory on all platforms: ~/.config/gh-codeowners/config.yml

color:
  comment: "#6A9955"
  error:   "#F44747"

License

Licensed under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
git

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址