You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --issue-pattern to extract issue IDs from custom subject formats
Built-in subject detection only matches identifiers that lead the subject
(`[ENG-123] …`, `(ENG-123) …`, `ENG-123: …`). Conventional Commits put the
identifier after the type and optional scope (`feat(scope)[ENG-123]: …`,
`fix[ENG-123]: …`), so it is never linked to the release. `--include-subjects`
is a filter, not an extractor, so it cannot recover the identifier either.
Add a `--issue-pattern=<regex>` flag (group 1 = team key, group 2 = issue
number) matched against the commit subject. Matching is global and
case-insensitive; the team key is upper-cased and leading zeros stripped,
leading-zero numbers rejected. It is additive to and de-duplicated with the
existing branch-name / magic-word / built-in-subject detection. The flag is
validated at parse time to compile and expose at least two capture groups.
Closes#106
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|`--issue-pattern`|`sync`| Extract issue identifiers from a custom subject format via a regex (group 1 = team key, group 2 = issue number). Use for conventions the built-in detection misses, e.g. Conventional Commits. |
159
160
|`--link`|`sync`, `complete`, `update`| Add a link to the targeted release. Use `--link "https://example.com"` or `--link "Label=https://example.com"`; repeat the flag to add multiple links. |
160
161
|`--document`|`sync`, `complete`, `update`| Attach a document. `--document "Title=...markdown..."`; repeat for multiple docs. Existing documents with the same title on the release are updated. |
161
162
|`--document-file`|`sync`, `complete`, `update`| Same as `--document` but reads the body from a file: `--document-file "Title=path/to/file.md"`. Use `-` to read from stdin. |
@@ -233,6 +234,29 @@ The regex is matched against the commit subject only (everything before the firs
233
234
234
235
`--include-subjects` composes with `--include-paths`: a commit must pass both filters to be scanned.
235
236
237
+
### Custom Issue Patterns
238
+
239
+
Out of the box, identifiers are detected from branch names, magic words (`Fixes ENG-123`), and common subject conventions where the identifier leads the subject — `[ENG-123] …`, `(ENG-123) …`, `ENG-123: …`. Some teams instead put the identifier _after_ a [Conventional Commits](https://www.conventionalcommits.org/) type and scope, which the built-in patterns don't recognize:
240
+
241
+
```
242
+
feat(routing)[ENG-123]: add stop reordering
243
+
fix[ENG-123]: handle empty payload
244
+
```
245
+
246
+
Use `--issue-pattern` to teach the scanner your convention. The flag takes a regex whose **first capture group is the team key** and **second capture group is the issue number**:
247
+
248
+
```bash
249
+
# Conventional Commits: type, optional (scope), optional !, then [TEAM-NUMBER]
The pattern is matched against the commit subject (first line) and scanned globally, so a subject may carry more than one identifier. Matching is case-insensitive; the team key is upper-cased and leading zeros on the number are stripped (`eng-0045` → `ENG-45`), and numbers written with a leading zero are rejected as invalid identifiers. Matches are merged with the built-in detection rather than replacing it, and de-duplicated across branch name and message.
257
+
258
+
> The CLI validates that the regex compiles and has at least two capturing groups, but it cannot know which substrings you intend as the team key and number — double-check the capture groups against a sample commit with `--dry-run --verbose`.
259
+
236
260
### Release Links
237
261
238
262
`--link` attaches external URLs to the release — a GitHub release page, a CI run, a deployment dashboard.
0 commit comments