Skip to content

[WORKFLOW] Create PR template validation workflow #717

@ashleyshaw

Description

@ashleyshaw

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

  1. Extract branch name from PR
  2. Look up expected template from PULL_REQUEST_TEMPLATE/config.yml
  3. Check PR body for required sections (changelog, risk assessment, test steps, etc.)
  4. If missing sections: post comment with template link
  5. If very wrong template: add "needs-template-fix" label
  6. 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

  • Workflow created and tested
  • Validates template sections correctly
  • Auto-comments on template violations
  • Blocks merge if critical sections missing
  • Works with all branch types

Metadata

Issue Type: Task
Priority: High
Phase: 3 - Automation & Enforcement
Effort: 2h
Depends on: #2, #4

Project: Template Enforcement & Governance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions