Tired of people ignoring your PR template?
- ✅ Verify required sections exist in PR descriptions
- ✅ Ensure all checklist items are checked before merge
- ✅ Post helpful comments guiding contributors to complete requirements
- ✅ Fully customizable — define your own required sections and checkboxes
- ✅ Concurrency-safe — handles rapid PR updates gracefully
Add this workflow to your repository at .github/workflows/pr-checklist.yml:
name: PR Checklist
on:
pull_request:
types: [opened, edited, synchronize, ready_for_review]
concurrency:
group: git-bounce-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
verify-checklist:
name: Verify PR Checklist
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Check PR Template
uses: erinmikailstaples/git-bounce@v1
with:
required-sections: '["## Description", "## Checklist"]'
required-checkboxes: '["I have tested my changes", "Ready for review"]'| Input | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token for API access | No | ${{ github.token }} |
required-checkboxes |
JSON array of checkbox text to require (case-insensitive) | No | '' |
required-sections |
JSON array of section headers to require | No | '' |
fail-on-missing-template |
Fail if PR body is empty | No | 'true' |
post-comment |
Post verification results as a PR comment | No | 'true' |
comment-on-success |
Post comment even when checks pass | No | 'true' |
| Output | Description |
|---|---|
status |
'success' or 'failure' |
missing-sections |
JSON array of missing required sections |
unchecked-items |
JSON array of unchecked required items |
missing-items |
JSON array of required items not found in PR |
Simplest setup — just fail if PR description is empty:
- uses: erinmikailstaples/git-bounce@v1- uses: erinmikailstaples/git-bounce@v1
with:
required-sections: '["## Describe your changes", "## Related Issues", "## Checklist before requesting a review"]'
required-checkboxes: |
[
"Is this ready for review",
"This has deployed to a staging environment correctly",
"I have reviewed my changes",
"I have confirmed the content is technically accurate",
"I have confirmed the content is free of typos or grammar errors",
"I have reviewed the deployed version of my changes",
"I have tested any code that is added or updated",
"I have verified all images and videos are clear",
"All checks have passed"
]- uses: erinmikailstaples/git-bounce@v1
with:
required-sections: '["## What", "## Why", "## Testing"]'
required-checkboxes: |
[
"Tests added/updated",
"Documentation updated",
"Ready for review"
]- uses: erinmikailstaples/git-bounce@v1
with:
post-comment: 'false'
required-checkboxes: '["Ready for review"]'- name: Check PR
id: bounce
uses: erinmikailstaples/git-bounce@v1
with:
required-checkboxes: '["Ready for review"]'
post-comment: 'false'
- name: Custom handling
if: steps.bounce.outputs.status == 'failure'
run: |
echo "Missing items: ${{ steps.bounce.outputs.missing-items }}"
echo "Unchecked items: ${{ steps.bounce.outputs.unchecked-items }}"Here's an example PR template (.github/PULL_REQUEST_TEMPLATE.md) that works well with Git Bounce:
## Description
<!-- Describe your changes -->
## Related Issues
<!-- Link related issues: Fixes #123 -->
## Checklist
- [ ] I have tested my changes
- [ ] Documentation updated (if needed)
- [ ] Ready for reviewGit Bounce works by matching text in your PR description. Here's how to configure it for your existing PR template:
Look at your PR template for markdown headers (lines starting with ##). Add each one you want to require to the required-sections input:
<!-- Your PR template has these sections: -->
## What Changed
## Why
## Testing Notes# Your workflow config:
required-sections: '["## What Changed", "## Why", "## Testing Notes"]'Find the checkbox items in your template. You only need to include enough text to uniquely identify each checkbox — Git Bounce does partial, case-insensitive matching:
<!-- Your PR template has these checkboxes: -->
- [ ] I have added tests that prove my fix is effective
- [ ] I have updated the documentation accordingly
- [ ] My changes generate no new warnings# You can use the full text or just the unique part:
required-checkboxes: |
[
"added tests",
"updated the documentation",
"no new warnings"
]- Create a test PR with an empty description — it should fail
- Add the template but leave boxes unchecked — it should fail and list unchecked items
- Check all boxes — it should pass
- Section matching is exact —
"## Description"won't match## descriptionor## Descriptions - Checkbox matching is flexible —
"tested my changes"matches- [x] I have tested my changes locally - Don't include the checkbox syntax — use
"Ready for review"not"- [ ] Ready for review"
- When a PR is opened, edited, or updated, Git Bounce checks the PR description
- It verifies all required sections are present
- It ensures all required checkboxes are checked (not just present)
- It posts a comment summarizing the results
- The workflow fails if any requirements aren't met, blocking merge
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
