Skip to content

feat[ci-cd]: add pr title validation #1

feat[ci-cd]: add pr title validation

feat[ci-cd]: add pr title validation #1

Workflow file for this run

name: PR Title Enforcer
on:
pull_request:
types: [opened, edited, reopened, synchronize]
jobs:
validate-title:
runs-on: ubuntu-latest
steps:
- name: Validate PR Title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking PR title: $PR_TITLE"
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|improve|test|chore)\[[^]]+\]:\ .+ ]]; then
echo "::error::PR title must follow the format: 'type[scope]: description'"
exit 1
fi