Commit c1e68c9
[luv-336] fix: anchor workflow-policy regexes to command boundaries
The `release-prep-check`, `changelog-check`, `docs-check`, and
`pr-description-check` policies used unanchored regexes against the
Bash command string, so the literal phrases (`gh pr create`,
`git commit`, `git push`) matched anywhere — including inside HEREDOC
bodies or quoted arguments. Concrete failure: editing a PR body that
contained the words "gh pr create" inside backticks fired the new
`release-prep-check` policy on the `gh pr edit` invocation.
Extracts a shared `matchesCommand(cmd, verbPattern)` helper that
anchors the verb-phrase match to a command boundary (`^`, `;`, `&&`,
`||`, `|`, or newline). All four policies route through it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 3284b8e commit c1e68c9
2 files changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
8 | 21 | | |
9 | 22 | | |
10 | 23 | | |
| |||
13 | 26 | | |
14 | 27 | | |
15 | 28 | | |
16 | | - | |
| 29 | + | |
17 | 30 | | |
18 | 31 | | |
19 | 32 | | |
| |||
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
37 | | - | |
| 50 | + | |
38 | 51 | | |
39 | 52 | | |
40 | 53 | | |
| |||
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
56 | | - | |
| 69 | + | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| |||
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
77 | | - | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments