Skip to content

DEV-1168: Fetch current PR title on rerun #6

DEV-1168: Fetch current PR title on rerun

DEV-1168: Fetch current PR title on rerun #6

name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check for Linear issue ID
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }}
run: |
if [ "$PR_AUTHOR_TYPE" = "Bot" ]; then
echo "Bot PR — skipping check."
elif 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