name: PR Title Check
on:
pull_request:
branches:
- main
types: [opened, edited, synchronize, reopened]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check PR title format
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ ! "$PR_TITLE" =~ ^@W-[0-9]+ ]]; then
echo "❌ PR title must match the pattern '@W-<digits>' (e.g., @W-123456)"
exit 1
fi
echo "✅ PR title format is valid"