mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
Add support for kebab-case --allowed-tools flag (#581)
- Update parseAllowedTools to accept both --allowedTools and --allowed-tools - Add regex alternation to support both camelCase and kebab-case variants - Add test cases for unquoted and quoted kebab-case formats - All existing tests continue to pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -68,4 +68,20 @@ describe("parseAllowedTools", () => {
|
||||
"mcp__github_comment__update",
|
||||
]);
|
||||
});
|
||||
|
||||
test("parses kebab-case --allowed-tools", () => {
|
||||
const args = "--allowed-tools mcp__github__*,mcp__github_comment__*";
|
||||
expect(parseAllowedTools(args)).toEqual([
|
||||
"mcp__github__*",
|
||||
"mcp__github_comment__*",
|
||||
]);
|
||||
});
|
||||
|
||||
test("parses quoted kebab-case --allowed-tools", () => {
|
||||
const args = '--allowed-tools "mcp__github__*,mcp__github_comment__*"';
|
||||
expect(parseAllowedTools(args)).toEqual([
|
||||
"mcp__github__*",
|
||||
"mcp__github_comment__*",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user