Skip to content

DEV-1168: Pass title check for bot PRs and fetch current title on rerun #4

DEV-1168: Pass title check for bot PRs and fetch current title on rerun

DEV-1168: Pass title check for bot PRs and fetch current title on rerun #4

name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
check-title:
if: ${{ github.event.pull_request.user.type != 'Bot' }}
runs-on: ubuntu-latest
steps:
- name: Check for Linear issue ID
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if echo "$PR_TITLE" | grep -qPi '^[A-Z]+[-\s]\d+\b'; then
echo "PR title starts with a Linear issue ID."
elif echo "$PR_TITLE" | grep -qPi '^NO-ISSUE\b'; then
echo "::notice::PR explicitly opted out of issue association."
else
echo "::error::PR title must start with a Linear issue ID (e.g., \"ENG-123: Add feature\") or \"NO-ISSUE:\" to opt out."
exit 1
fi