From 86bcb1d46c2ce630a28d6d0883619f212b641d2f Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Sat, 28 Mar 2026 20:09:55 +0200 Subject: [PATCH 1/3] Add advisory PR title check for Linear ticket IDs --- .github/workflows/pr-title-check.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/pr-title-check.yml diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml new file mode 100644 index 0000000..1bbad1c --- /dev/null +++ b/.github/workflows/pr-title-check.yml @@ -0,0 +1,20 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + check-title: + runs-on: ubuntu-latest + steps: + - name: Check for Linear ticket ID + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + if echo "$PR_TITLE" | grep -qP '[A-Z]+-\d+'; then + echo "PR title contains a Linear ticket ID." + else + echo "::warning::PR title should contain a Linear ticket ID (e.g., ENG-123)" + exit 1 + fi From b2ead8e763d844aa93177d131599748ad58ac639 Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Sat, 28 Mar 2026 20:11:38 +0200 Subject: [PATCH 2/3] Require ticket ID at start of PR title --- .github/workflows/pr-title-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index 1bbad1c..b094b08 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -12,9 +12,9 @@ jobs: env: PR_TITLE: ${{ github.event.pull_request.title }} run: | - if echo "$PR_TITLE" | grep -qP '[A-Z]+-\d+'; then - echo "PR title contains a Linear ticket ID." + if echo "$PR_TITLE" | grep -qP '^[A-Z]+-\d+\b'; then + echo "PR title starts with a Linear ticket ID." else - echo "::warning::PR title should contain a Linear ticket ID (e.g., ENG-123)" + echo "::warning::PR title must start with a Linear ticket ID (e.g., \"ENG-123: Add feature\")" exit 1 fi From 0823a073620f968c56dd0d2e82b73942b7ceb98b Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Sat, 28 Mar 2026 20:13:45 +0200 Subject: [PATCH 3/3] Make ticket ID check case-insensitive and allow space separator --- .github/workflows/pr-title-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml index b094b08..03a5e39 100644 --- a/.github/workflows/pr-title-check.yml +++ b/.github/workflows/pr-title-check.yml @@ -12,7 +12,7 @@ jobs: env: PR_TITLE: ${{ github.event.pull_request.title }} run: | - if echo "$PR_TITLE" | grep -qP '^[A-Z]+-\d+\b'; then + if echo "$PR_TITLE" | grep -qPi '^[A-Z]+[-\s]\d+\b'; then echo "PR title starts with a Linear ticket ID." else echo "::warning::PR title must start with a Linear ticket ID (e.g., \"ENG-123: Add feature\")"