Validates that Pull Request descriptions include mandatory sections with quality content.
This action ensures a minimum standard for change documentation and prevents PRs with incomplete or invalid information.
| Section | Status | Description |
|---|---|---|
| Description | Required | Change summary |
| Task | Required or N/A | Task link |
| Demo | Required or N/A | Video link |
| Check | Implementation | Threshold |
|---|---|---|
| Length | Count visible characters | ≥ 30 chars |
| Emojis | Unicode emoji detection | < 50% emojis |
| Repetition | Character frequency analysis | No excessive repetition |
| N/A Usage | Exact match validation | Only in Task/Demo |
Add this job to your existing .github/workflows/ YAML file:
jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- name: Check PR Description
uses: Michael0967/pr-validator@v1.0.8Description: Brief summary of your changes here.
Task: https://your-task-manager.com/task/123 or N/A
Demo: https://your-video-link.com or N/AThe action automatically validates PR descriptions on every update.
| Rule | Result | Example |
|---|---|---|
| Missing section | Error | No Description: section |
| Empty content | Error | Description: (empty) |
| Too short | Error | Description: Bug fix |
| Emoji spam | Error | Description: 🐛✨🎉 |
| Valid N/A | Success | Task: N/A |
| Step | Action | Description |
|---|---|---|
| 1 | Input Processing | Read pr-body input or github.context.payload.pull_request.body |
| 2 | Section Extraction | Parse Description:, Task:, Demo: with regex |
| 3 | Content Cleaning | Remove HTML, comments, Markdown formatting |
| 4 | Validation | Apply all validation rules |
| 5 | Result | Pass or fail with detailed feedback |
| Check | Implementation | Threshold |
|---|---|---|
| Length | Count visible characters | ≥ 30 chars |
| Emojis | Unicode emoji detection | < 50% emojis |
| Repetition | Character frequency analysis | No excessive repetition |
| N/A Usage | Exact match validation | Only in Task/Demo |
Complete:
Description: Added user authentication feature with JWT tokens.
Task: https://monday.com/boards/123/pulses/456
Demo: https://www.loom.com/share/abc123With N/A:
Description: Fixed the checkout form validation bug.
Task: N/A
Demo: https://www.loom.com/share/xyz789Missing sections:
Description: Added new feature
# Missing Task and DemoToo short:
Description: Bug fix
Task: N/A
Demo: N/AEmoji spam:
Description: 🐛✨🎉🔥💯
Task: N/A
Demo: N/A@actions/core- Input handling and logging@actions/github- GitHub context access
MIT © 2025
[Report Bug](https://github.com/Michael0967/pr-validator/issues) • [Request Feature](https://github.com/Michael0967/pr-validator/issues)