Create GitHub Actions workflow that validates PR template compliance.
Details
- File:
.github/workflows/validate-pr-template.yml
- Runs on: pull_request (opened, synchronize, edited)
- Detects branch prefix (feat/, fix/, chore/, etc.)
- Checks if PR body contains required template sections
- Fails if wrong template detected
- Auto-comments with helpful correction link
Validation Logic
- Extract branch name from PR
- Look up expected template from PULL_REQUEST_TEMPLATE/config.yml
- Check PR body for required sections (changelog, risk assessment, test steps, etc.)
- If missing sections: post comment with template link
- If very wrong template: add "needs-template-fix" label
- Block merge if template missing (status check)
Required Sections by Type
- All PRs: Linked issues, Changelog
- feat/: Changelog (Added), Test steps, Accessibility checklist
- fix/: Root cause, Verification, Risk assessment
- chore/: Changelog (if user-facing), Test steps
- docs/: Changelog (optional), no code changes
Acceptance Criteria
Metadata
Issue Type: Task
Priority: High
Phase: 3 - Automation & Enforcement
Effort: 2h
Depends on: #2, #4
Project: Template Enforcement & Governance
Create GitHub Actions workflow that validates PR template compliance.
Details
.github/workflows/validate-pr-template.ymlValidation Logic
Required Sections by Type
Acceptance Criteria
Metadata
Issue Type: Task
Priority: High
Phase: 3 - Automation & Enforcement
Effort: 2h
Depends on: #2, #4
Project: Template Enforcement & Governance