Fix npm script allowlist patterns in Claude workflows#802
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
danbarr
approved these changes
Apr 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Claude Code workflow tool allowlist patterns so npm run <script>:fix commands are correctly auto-approved by switching from the :* suffix (argument wildcard) to explicit npm script names.
Changes:
- Replace
Bash(npm run <script>:*)entries with explicitBash(npm run <script>)andBash(npm run <script>:fix)allowlist entries. - Apply the allowlist fix to both the upstream release docs workflow and the
@claudemention workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/upstream-release-docs.yml | Updates Claude Code --allowed-tools to explicitly allow build, prettier, prettier:fix, eslint, eslint:fix for both skill invocations. |
| .github/workflows/claude.yml | Updates the mention-triggered Claude Code workflow --allowed-tools to explicitly allow the same npm scripts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PR #793 added
Bash(npm run prettier:*)/Bash(npm run eslint:*)/Bash(npm run build:*)to--allowed-toolsinclaude.ymlandupstream-release-docs.yml, intending the:*suffix to cover the:fixscript variants as a wildcard. It doesn't.In Claude Code's Bash permission grammar,
:*is aliased to a space-separated argument wildcard:Bash(foo:*) == Bash(foo *). The space enforces a word boundary. From the Claude Code permissions docs:So
Bash(npm run prettier:*)matchesnpm run prettier --foo(with a space before the arg) but notnpm run prettier:fix, because:fixis part of the script name, not an argument — the permission matcher seesnpm run prettier:fixas one token.Fix: replace the wildcarded patterns with explicit script names for the five scripts these workflows actually invoke (
build,prettier,prettier:fix,eslint,eslint:fix, all declared inpackage.json).Bash(gh:*)inupstream-release-docs.ymlstays as-is —ghis a real CLI with real subcommands, so the arg wildcard is correct there.Reported by @danbarr watching the 0.24.1 docs PR —
npm run prettier:fixwas still prompting "This command requires approval" despite the allowlist entry.Type of change
Related issues/PRs
Follow-up to #793.
Test plan
@claudemention a PR and ask Claude to runnpm run prettier:fix— command should auto-approve.npm run eslint:fixcall runs without approval prompts.🤖 Generated with Claude Code