Problem
Issue identifiers are extracted from a commit subject only when the identifier leads the subject. The three built-in subject conventions in src/extractors.ts (COMMON_SUBJECT_PATTERNS) are all start-anchored:
[ENG-123] My change
(ENG-123) My change
ENG-123: My change
Teams that follow Conventional Commits put the identifier after the type and optional scope, so none of these match and the issue is never linked to the release:
feat(routing)[ENG-123]: add stop reordering
fix[ENG-123]: handle empty payload
chore(deps)[ENG-7]: bump
(fix[ENG-123] also slips past the fix magic-word path, since that path requires whitespace/colon after the keyword, not [.)
--include-subjects doesn't help here — it's a filter (decides which commits to scan), not an extractor (it can't tell the CLI where the identifier lives within the subject). There's currently no way to teach the scanner a custom subject convention.
Proposal
Add a --issue-pattern=<regex> flag for sync. The user supplies a regex whose first capture group is the team key and second capture group is the issue number:
# Conventional Commits: type, optional (scope), optional !, then [TEAM-NUMBER]
linear-release sync --issue-pattern="\w+(?:\([^)]*\))?!?\[(\w+)-(\d+)\]"
Behavior:
- Matched against the commit subject (first line only), consistent with
--include-subjects and the built-in subject patterns.
- Scanned globally, so a subject may carry more than one identifier.
- Case-insensitive; team key upper-cased and leading zeros stripped (
eng-0045 → ENG-45); numbers written with a leading zero are rejected, matching parseMatch.
- Additive — merged with the existing branch-name / magic-word / built-in-subject detection and de-duplicated, not a replacement.
- Validated at parse time: the regex must compile and have at least two capturing groups (helpful error otherwise).
This keeps the default detection untouched while giving teams an escape hatch for any subject convention the built-ins don't recognize.
Happy to send a PR (already drafted, with unit tests + README docs).
Problem
Issue identifiers are extracted from a commit subject only when the identifier leads the subject. The three built-in subject conventions in
src/extractors.ts(COMMON_SUBJECT_PATTERNS) are all start-anchored:[ENG-123] My change(ENG-123) My changeENG-123: My changeTeams that follow Conventional Commits put the identifier after the type and optional scope, so none of these match and the issue is never linked to the release:
(
fix[ENG-123]also slips past thefixmagic-word path, since that path requires whitespace/colon after the keyword, not[.)--include-subjectsdoesn't help here — it's a filter (decides which commits to scan), not an extractor (it can't tell the CLI where the identifier lives within the subject). There's currently no way to teach the scanner a custom subject convention.Proposal
Add a
--issue-pattern=<regex>flag forsync. The user supplies a regex whose first capture group is the team key and second capture group is the issue number:Behavior:
--include-subjectsand the built-in subject patterns.eng-0045→ENG-45); numbers written with a leading zero are rejected, matchingparseMatch.This keeps the default detection untouched while giving teams an escape hatch for any subject convention the built-ins don't recognize.
Happy to send a PR (already drafted, with unit tests + README docs).