Skip to content

Commit 3f5527e

Browse files
rdimitrovclaude
andauthored
Fix npm script allowlist patterns in Claude workflows (#802)
PR #793 added `Bash(npm run prettier:*)` etc. to --allowed-tools, intending the wildcard to cover the `:fix` variants. It doesn't: in Claude Code's permission grammar, the `:*` suffix is aliased to a space-separated arg wildcard (Bash(foo:*) == Bash(foo *)), which enforces a word boundary. `npm run prettier:fix` has no space after `prettier` -- the `:fix` is part of the script name, not an arg -- so the pattern never matches and the command keeps prompting for approval. Replace the wildcarded patterns with explicit script names for the five scripts the workflows actually invoke (`build`, `prettier`, `prettier:fix`, `eslint`, `eslint:fix`). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3b1a856 commit 3f5527e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ jobs:
6161
additional_permissions: |
6262
actions: read
6363
claude_args: |
64-
--allowed-tools "Bash(npm run build:*) Bash(npm run prettier:*) Bash(npm run eslint:*)"
64+
--allowed-tools "Bash(npm run build) Bash(npm run prettier) Bash(npm run prettier:fix) Bash(npm run eslint) Bash(npm run eslint:fix)"

.github/workflows/upstream-release-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ jobs:
558558
claude_args: |
559559
--model claude-opus-4-7
560560
--max-turns 1000
561-
--allowed-tools "Bash(gh:*) Bash(npm run build:*) Bash(npm run prettier:*) Bash(npm run eslint:*)"
561+
--allowed-tools "Bash(gh:*) Bash(npm run build) Bash(npm run prettier) Bash(npm run prettier:fix) Bash(npm run eslint) Bash(npm run eslint:fix)"
562562
prompt: |
563563
You are running in GitHub Actions with no interactive user. Follow
564564
these steps exactly and do NOT ask clarifying questions -- proceed
@@ -752,7 +752,7 @@ jobs:
752752
claude_args: |
753753
--model claude-opus-4-7
754754
--max-turns 200
755-
--allowed-tools "Bash(gh:*) Bash(npm run build:*) Bash(npm run prettier:*) Bash(npm run eslint:*)"
755+
--allowed-tools "Bash(gh:*) Bash(npm run build) Bash(npm run prettier) Bash(npm run prettier:fix) Bash(npm run eslint) Bash(npm run eslint:fix)"
756756
prompt: |
757757
You are running in GitHub Actions with no interactive user. Follow
758758
these steps exactly and do NOT ask clarifying questions -- proceed

0 commit comments

Comments
 (0)