An Action that checks if files are covered by the CODEOWNERS file.
Forked from sibipro/codeowners-coverage to add PR comment support and debug logging improvements. sibipro/codeowners-coverage is itself a fork of austenstone/codeowners-coverage, which is no longer actively maintained.
- PR comments — New
comment-on-prinput to post/update a comment on PRs listing uncovered files with coverage percentage. The comment is automatically updated when all files become covered. - Debug logging — Verbose output (file lists, glob patterns) is now gated behind debug mode instead of always logging.
Create a workflow (eg: .github/workflows/seat-count.yml). See Creating a Workflow file.
name: CODEOWNERS
on:
workflow_dispatch:
jobs:
run:
name: Run Action
runs-on: ubuntu-latest
steps:
- uses: marcofranzen99/codeowners-coverage@v2.0Post a comment on pull requests listing files not covered by CODEOWNERS.
name: CODEOWNERS
on:
pull_request:
permissions:
pull-requests: write
jobs:
run:
name: Check Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: marcofranzen99/codeowners-coverage@v2.0
with:
comment-on-pr: 'true'Pass the files in to check only specific files. Combine with tj-actions/changed-files to check only files changed.
name: CODEOWNERS
on:
push:
pull_request:
jobs:
run:
name: Check Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: changed-files
uses: tj-actions/changed-files@v29.0.3
- uses: marcofranzen99/codeowners-coverage@v2.0
with:
ignore-default: 'true'
files: ${{ steps.changed-files.outputs.all_changed_files }}Various inputs are defined in action.yml:
| Name | Description | Default |
|---|---|---|
| github‑token | Token to use to authorize. | ${{ github.token }} |
| include-gitignore | Whether to filter our files in .gitignore | true |
| ignore-default | Whether to ignore the default rule * in CODEOWNERS file |
false |
| files | Filter check to only specific files | N/A |
| comment-on-pr | Post a PR comment listing uncovered files (requires pull-requests: write permission) |
false |
To get more help on the Actions see documentation.