This action can:
- Check if all files are covered by a CODEOWNERS Rule
- Check if all modified files are covered by a CODEOWNERS Rule. (PR)
- Check if all CODEOWNER rules are used.
steps:
- uses: actions/checkout@v4
- name: CODEOWNERS Check
id: test-action
uses: joelharkes/gh-action-codeowner-coverage@v1
with:
includeGitignore: 'false'
ignoreDefault: 'false'
allRulesMustHit: 'true' # Action will fail if there is a rule that is not used.
name: CODEOWNERS Check on modified files
on:
pull_request:
branches:
- main
permissions:
contents: read
jobs:
codeowners:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: CODEOWNERS Check
id: test-action
uses: joelharkes/gh-action-codeowner-coverage@v1
with:
files: ${{ steps.changed-files.outputs.all_changed_files }}
includeGitignore: 'false'
ignoreDefault: 'false'
steps:
- uses: actions/checkout@v4
- name: CODEOWNERS Check
id: codeowners
uses: joelharkes/gh-action-codeowner-coverage@v1
with:
milliseconds: 1000
- name: Print Output
id: output
run: echo "${{ steps.codeowners.outputs.missedFiles }}"
See: typescript-action template on how to run, test and contribute to GitHub Actions.