A GitHub Action that validates your CODEOWNERS file against specified source folders. It ensures every file in those folders has an owner and that every relevant rule in CODEOWNERS matches at least one file.
- Coverage: Every file under the specified folders is matched by at least one rule in
CODEOWNERS. Files without owners cause the action to fail. - No orphan rules: Every rule in
CODEOWNERSthat is relevant to the specified folders matches at least one file. Rules that don't match any file cause the action to fail (so you can clean up obsolete entries).
| Input | Required | Default | Description |
|---|---|---|---|
path |
Yes | ./.github/CODEOWNERS |
Path to the CODEOWNERS file. |
folders |
Yes | src |
Newline-separated list of folders to validate. |
Folder entries are trimmed; empty lines are ignored. Leading ! is preserved (e.g. ! vendor).
- uses: your-org/codeowners-validator-action@v1
with:
path: ./.github/CODEOWNERS
folders: |
src- uses: your-org/codeowners-validator-action@v1
with:
path: ./CODEOWNERS
folders: |
src
lib
packagesname: Validate CODEOWNERS
on: [pull_request, push]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: your-org/codeowners-validator-action@v1
with:
path: ./.github/CODEOWNERS
folders: |
src
libnpm installnpm run build && npm run packagenpm testYou can run the action from the repo root (see .github/workflows/test.yml):
uses: ./
with:
path: ./CODEOWNERS
folders: |
./src- Build and package:
npm run package - Commit and push the
dist/folder to your distribution branch (e.g.releases/v1).
See GitHub Actions versioning for tagging and versioning.
See LICENSE.