Skip to content

Commit 7a84dcf

Browse files
PROC-1513: accept Conventional Commit titles with Linear ID in scope (#6)
## Summary Widen the PR title check so titles like `feat(ENG-123): add feature` are accepted in addition to the existing `ENG-123: ...` and `NO-ISSUE:` formats. ## Why Adopting [release-please](https://github.com/googleapis/release-please) in `cloud_optimized_dicom` (see [PR #97](gradienthealth/cloud_optimized_dicom#97)) requires PR titles to start with a Conventional Commit type prefix (`feat:`, `fix:`, `chore:`, etc.) so the bot can decide the next version. The existing org-level check requires the Linear ID at the very start, which conflicts. Putting the Linear ID inside the conventional-commit scope (`feat(ENG-123): ...`) satisfies both worlds, but the current regex doesn't recognize it. ## Change Two new branches added to the existing if/elif chain: - Conventional Commit with Linear ID in scope: `feat(ENG-123): add feature` - Conventional Commit with `NO-ISSUE` opt-out: `chore: NO-ISSUE refactor internals` Existing formats continue to pass — pure superset, zero behavior change for repos not adopting Conventional Commits. ## Test plan - [ ] Title `ENG-123: existing format` → passes (unchanged) - [ ] Title `feat(ENG-123): new format` → passes (new) - [ ] Title `NO-ISSUE: opt-out` → passes (unchanged) - [ ] Title `chore: NO-ISSUE thing` → passes (new) - [ ] Title `random title with no marker` → fails
1 parent b106dda commit 7a84dcf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎.github/workflows/pr-title-check.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ jobs:
2121
echo "Bot PR — skipping check."
2222
elif echo "$PR_TITLE" | grep -qPi '^[A-Z]+[-\s]\d+\b'; then
2323
echo "PR title starts with a Linear issue ID."
24+
elif echo "$PR_TITLE" | grep -qP '^[a-z]+(\([^)]*[A-Z]+[-\s]\d+[^)]*\))!?:'; then
25+
echo "PR title is a Conventional Commit with a Linear issue ID in scope."
2426
elif echo "$PR_TITLE" | grep -qPi '^NO-ISSUE\b'; then
2527
echo "::notice::PR explicitly opted out of issue association."
28+
elif echo "$PR_TITLE" | grep -qPi '^[a-z]+(\([^)]*\))?!?:\s*NO-ISSUE\b'; then
29+
echo "::notice::PR explicitly opted out of issue association (conventional commit style)."
2630
else
27-
echo "::error::PR title must start with a Linear issue ID (e.g., \"ENG-123: Add feature\") or \"NO-ISSUE:\" to opt out."
31+
echo "::error::PR title must start with a Linear issue ID (e.g., \"ENG-123: Add feature\"), include one in a conventional-commit scope (e.g., \"feat(ENG-123): add feature\"), or use \"NO-ISSUE\" to opt out."
2832
exit 1
2933
fi

0 commit comments

Comments
 (0)