- Validates all
.playbook.mdfiles in your repository on pull requests - Reports errors and warnings as inline PR annotations
- Writes a summary table to the GitHub Actions job summary
- Supports custom glob patterns and strict mode
- Uses
@playbook-md/coredirectly -- no external dependencies required on the runner
Validate all .playbook.md files in your repository:
name: Validate Playbooks
on: [pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: PLAYBOOK-MD/playbook-action@v1Validate playbooks in a specific directory:
- uses: PLAYBOOK-MD/playbook-action@v1
with:
pattern: 'workflows/**/*.playbook.md'Treat warnings as errors (fail the check if any warnings are found):
- uses: PLAYBOOK-MD/playbook-action@v1
with:
strict: 'true'Access validation results in subsequent steps:
- uses: PLAYBOOK-MD/playbook-action@v1
id: validate
- run: |
echo "Valid: ${{ steps.validate.outputs.valid }}"
echo "Total: ${{ steps.validate.outputs.total }}"
echo "Errors: ${{ steps.validate.outputs.errors }}"
echo "Warnings: ${{ steps.validate.outputs.warnings }}"| Input | Description | Required | Default |
|---|---|---|---|
pattern |
Glob pattern for playbook files to validate | No | **/*.playbook.md |
strict |
Treat warnings as errors | No | false |
| Output | Description |
|---|---|
valid |
Whether all playbooks are valid (true/false) |
total |
Total number of playbooks validated |
errors |
Total number of errors found |
warnings |
Total number of warnings found |
The action writes a markdown summary table to $GITHUB_STEP_SUMMARY, visible on the Actions run page:
| File | Status | Errors | Warnings |
|---|---|---|---|
workflows/review.playbook.md |
Valid | 0 | 0 |
workflows/deploy.playbook.md |
Invalid | 2 | 1 |
Total: 2 file(s) validated, 2 error(s), 1 warning(s)
Errors and warnings appear as inline annotations on the pull request diff, pointing to the exact file and line where the issue was found.
Add a badge to your repository README:
- Node.js 20+
- npm
npm installThe action must be bundled into dist/index.js before committing. This bundles all dependencies into a single file so the action runs without node_modules.
npm run buildnpm run typecheckMIT