Task List Validator
Validate task list completion in PR descriptions
The Task List Validator ensures that task lists (checkboxes) in pull request descriptions are completed. This is useful for enforcing pre-merge checklists, ensuring contributors follow important steps before their PRs are merged.
Configuration
Must be set to "taskList"
Section heading patterns to validate (checks task lists in these sections)
Custom message to display when validation fails
Basic Usage
Examples
Simple Checklist Validation
Ensure all tasks in the “Checklist” section are completed:
Multiple Sections
Check tasks in multiple sections:
Pattern Matching
Use patterns to match section headings:
How It Works
Parse Description
The validator parses the PR description to identify markdown sections and task lists
Identify Sections
It identifies sections that match the patterns specified in include
Check Task Lists
For each matching section, it verifies all task list items are checked
Return Result
Returns a validation result with status (pass, fail, or error) and a message
The validator looks for Markdown task lists in the format:
Example PR Template
To make the most of this validator, create a PR template with task lists:
Save this template as .github/PULL_REQUEST_TEMPLATE.md
in your repository.
Practical Use Cases
Pre-Merge Checklist
Ensure contributors confirm important checks before merging:
Different Checklists by PR Type
Apply different checklists based on the type of PR:
Security Checklist
Enforce a security checklist for certain types of changes:
Specialized PR Templates
You can create specialized PR templates for different scenarios by using directories:
- Create a directory:
.github/PULL_REQUEST_TEMPLATE/
- Add template files like:
feature.md
- Template for feature PRsbugfix.md
- Template for bug fixessecurity.md
- Template for security-related changes
Contributors can then use the template that fits their PR:
Best Practices
Don’t make checklists too long or contributors might check items without properly considering them
Customizing Feedback
Provide helpful guidance when tasks are incomplete: