Commit Graph

254 Commits

Author SHA1 Message Date
km-anthropic
b1820e0342 Test: Verify gh pr comment works 2025-08-12 09:18:24 -07:00
km-anthropic
5a9f227619 Simplify PR review: Use gh CLI to post comments
- Removed custom create_comment tool
- Updated workflow to use gh pr comment command
- Allowed Bash(gh pr comment:*) tool
- Simplified prompt to be more user-friendly
2025-08-12 09:17:45 -07:00
km-anthropic
86b376366f Test: Verify MCP servers work correctly 2025-08-12 08:56:09 -07:00
km-anthropic
05d9889165 Fix: Use correct MCP server names and add inline comment server for PRs
- Changed github-comment-server to github_comment (correct registration name)
- Added github_inline_comment server for PR contexts
- Updated workflow to use correct tool names (mcp__github_inline_comment__)
- Simplified prompt to use inline comments instead of full PR reviews
2025-08-12 08:54:10 -07:00
km-anthropic
708a97434b Test: Verify Claude uses GitHub review tools 2025-08-12 08:26:26 -07:00
km-anthropic
23491a8791 Fix: Explicitly instruct Claude to use GitHub review tools 2025-08-12 08:25:56 -07:00
km-anthropic
262c847203 Test: Third attempt with GitHub token 2025-08-12 08:20:55 -07:00
km-anthropic
33463c0075 Fix: Add GitHub token to workflow 2025-08-12 08:19:57 -07:00
km-anthropic
239d95f919 Test: Another attempt to verify token fix 2025-08-12 08:18:39 -07:00
km-anthropic
e740506de0 Test: Use local action to test token fix 2025-08-12 08:18:01 -07:00
km-anthropic
b324e00c16 Test: Verify GitHub token is passed to MCP servers 2025-08-12 08:13:39 -07:00
km-anthropic
0c533aaff5 Fix: Pass GitHub token to MCP servers in agent mode
The token was being obtained successfully but not outputted from the prepare step for use in later steps. Added explicit output of the GitHub token and debug logging.
2025-08-11 16:17:01 -07:00
km-anthropic
8102aebe6d Test: Verify Claude doesn't approve PRs 2025-08-11 15:07:40 -07:00
km-anthropic
57cb0d9828 Match old workflow exactly - prevent approvals
- Use exact same permissions as old workflow
- Use fetch-depth: 1 like old workflow
- Remove timeout and extra features
- Only trigger on opened PRs
- Use claude_args with --allowedTools format
2025-08-11 14:54:48 -07:00
km-anthropic
44dd9dd8a8 Final test: Update README for complete review workflow test 2025-08-11 14:01:41 -07:00
km-anthropic
8052d271ce Enable PR review submission and remove old workflow
- Add back review submission tools to allow Claude to comment
- Keep using v1-dev with the fixed agent mode
- This replaces the old claude-review.yml functionality
2025-08-11 14:00:48 -07:00
km-anthropic
b61185b14c Test: Update README title for workflow testing 2025-08-11 13:55:00 -07:00
km-anthropic
808408602d Simplify review workflow - prevent multiple submissions
- Rename workflow to avoid conflicts
- Remove review submission tools
- Keep only essential tools for reading and analyzing PR
2025-08-11 13:53:02 -07:00
km-anthropic
c03f13d243 Fix agent mode to include GitHub MCP server with proper token 2025-08-11 13:46:35 -07:00
km-anthropic
d7a5b003e4 Update agent mode to have github server as a default 2025-08-11 13:22:11 -07:00
km-anthropic
0e90e18ac5 registry test update 2025-08-11 07:51:18 -07:00
km-anthropic
65d9b310c7 tests, typecheck, format 2025-08-11 07:51:09 -07:00
km-anthropic
c7801e975c bun format 2025-08-11 07:32:05 -07:00
km-anthropic
c93188b5fb Merge branch 'main' into v1-dev
Resolved conflicts:
- src/modes/agent/index.ts: Kept v1-dev approach (user controls via claude_args)
- src/modes/review/index.ts: Kept deleted (review mode removed in v1-dev)
2025-08-11 07:10:27 -07:00
km-anthropic
d5fbc80b71 Fix MCP tool availability and shell escaping in tag mode
Pass MCP config and allowed tools through claude_args to ensure tools like
mcp__github_comment__update_claude_comment are properly available to Claude CLI.

Key changes:
- Tag mode outputs claude_args with MCP config (as JSON string) and allowed tools
- Fixed shell escaping vulnerability when JSON contains single quotes
- Agent mode passes through user-provided claude_args unchanged
- Re-added mcp_config input for users to provide custom MCP servers
- Cleaned up misleading comments and unused file operations
- Clarified test workflow is for fork testing

Security fix: Properly escape single quotes in MCP config JSON to prevent
shell injection vulnerabilities.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 06:42:03 -07:00
Ashwin Bhat
4f4f43f044 docs: add prominent notice about upcoming v1.0 breaking changes (#437)
- Add GitHub alert box highlighting the v1.0 roadmap
- Link to discussion #428 for community feedback
- Briefly summarize key changes (automatic mode selection, unified prompt interface)
- Position prominently at top of README for maximum visibility
2025-08-10 16:19:08 -07:00
km-anthropic
5bdb1e4ae0 Fix MCP config not being passed to Claude CLI
The MCP servers (including github_comment server) were configured but not passed to Claude. This caused the "update_claude_comment" tool to be unavailable.

Changes:
- Write MCP config to a file at $RUNNER_TEMP/claude-mcp-config.json
- Add mcp_config_file output from prepare.ts
- Pass MCP config file via --mcp-config flag in claude_args
- Use fs/promises writeFile to match codebase conventions
2025-08-08 16:39:33 -07:00
Matthew Burke
8a5d751740 fix - allowed and disallowed tools ignored in agent mode (#424) 2025-08-08 14:34:55 -07:00
km-anthropic
1b4fc382c8 Simplify agent mode and re-add additional_permissions input
- Agent mode now only triggers when explicit prompt is provided
- Removed automatic triggering for workflow_dispatch/schedule without prompt
- Re-added additional_permissions input for requesting GitHub permissions
- Fixed TypeScript types for mock context helpers to properly handle partial inputs
- Updated documentation to reflect simplified mode behavior
2025-08-08 14:00:31 -07:00
km-anthropic
e2aee89b4a remove deprecated workflow file (tests features we no longer support) 2025-08-08 11:37:56 -07:00
km-anthropic
450e1a8259 Update package json 2025-08-08 11:24:23 -07:00
km-anthropic
3d480aa9c6 Merge branch 'main' of https://github.com/anthropics/claude-code-action into v1-dev 2025-08-08 11:19:04 -07:00
GitHub Actions
bc423b47f5 chore: bump Claude Code version to 1.0.72 2025-08-08 18:16:40 +00:00
km-anthropic
90461a9b4d Merge branch 'main' of https://github.com/anthropics/claude-code-action into v1-dev 2025-08-08 09:38:33 -07:00
Steve
6d5c92076b non negative line validation for comment server (#429)
* enforce non-negative validation for line in GH comment server

* include  .nonnegative() for startLine too
v0.0.55
2025-08-08 08:36:20 -07:00
km-anthropic
ed42f1a4c4 model version update 2025-08-08 01:23:49 -07:00
km-anthropic
f407f21830 fix: update MCP server tests after removing additionalPermissions
- Change github_ci server logic to check for workflow token presence
- Update test names to reflect new behavior
- Fix test that was incorrectly setting workflow token
2025-08-08 01:10:43 -07:00
km-anthropic
f59258677e refactor: complete v1.0 simplification by removing all legacy inputs
- Remove all backward compatibility for v1.0 simplification
- Remove 10 legacy inputs from base-action/action.yml
- Remove 9 legacy inputs from main action.yml
- Simplify ClaudeOptions type to just timeoutMinutes and claudeArgs
- Remove all legacy option handling from prepareRunConfig
- Update tests to remove references to deleted fields
- Remove obsolete test file github/context.test.ts
- Clean up types to remove customInstructions, allowedTools, disallowedTools

Users now use claudeArgs exclusively for CLI control.
2025-08-08 00:53:54 -07:00
Yuku Kotani
fec554fc7c feat: add flexible bot access control with allowed_bots option (#117)
* feat: skip permission check for GitHub App bot users

GitHub Apps (users ending with [bot]) now bypass permission checks
as they have their own authorization mechanism.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add allow_bot_users option to control bot user access

- Add allow_bot_users input parameter (default: false)
- Modify checkHumanActor to optionally allow bot users
- Add comprehensive tests for bot user handling
- Improve security by blocking bot users by default

This change prevents potential prompt injection attacks from bot users
while providing flexibility for trusted bot integrations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: mark bot user support feature as completed in roadmap

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: move allowedBots parameter to context object

Move allowedBots from function parameter to context.inputs to maintain
consistency with other input handling throughout the codebase.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: update README for bot user support feature

Add documentation for the new allowed_bots parameter that enables
bot users to trigger Claude actions with granular control.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: add missing allowedBots property in permissions test

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: update bot name format to include [bot] suffix in tests and docs

- Update test cases to use correct bot actor names with [bot] suffix
- Update documentation example to show correct bot name format
- Align with GitHub's actual bot naming convention

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: normalize bot names for allowed_bots validation

- Strip [bot] suffix from both actor names and allowed bot list for comparison
- Allow both "dependabot" and "dependabot[bot]" formats in allowed_bots input
- Display normalized bot names in error messages for consistency
- Add comprehensive test coverage for both naming formats

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-07 18:03:20 -07:00
GitHub Actions
59ca6e42d9 chore: bump Claude Code version to 1.0.71 2025-08-07 22:57:57 +00:00
km-anthropic
f2775d66df format 2025-08-07 15:48:07 -07:00
km-anthropic
a7759cfcd1 feat: add claudeArgs input for direct CLI argument passing
- Add claude_args input to action.yml for flexible CLI control
- Parse arguments with industry-standard shell-quote library
- Maintain proper argument order: -p [claudeArgs] [legacy] [BASE_ARGS]
- Keep tag mode defaults (needed for functionality)
- Agent mode has no defaults (full user control)
- Add comprehensive tests for new functionality
- Add example workflow showing usage
2025-08-07 15:45:17 -07:00
km-anthropic
e2bdca6133 bun format 2025-08-07 15:18:44 -07:00
km-anthropic
b6238ad00e refactor: use industry-standard shell-quote for argument parsing
- Replace custom parseShellArgs with battle-tested shell-quote package
- Simplify code by removing unnecessary -p filtering (Claude handles it)
- Update tests to use shell-quote directly
- Add example workflow showing claude_args usage

This provides more robust argument parsing while reducing code complexity.
2025-08-07 15:18:00 -07:00
km-anthropic
dfcaac854e feat: add claudeArgs input for direct CLI argument passing
- Add claude_args input to both action.yml files
- Implement shell-style argument parsing with quote handling
- Pass arguments directly to Claude CLI for maximum flexibility
- Add comprehensive tests for argument parsing
- Log custom arguments for debugging

Users can now pass any Claude CLI arguments directly:
  claude_args: '--max-turns 3 --mcp-config /path/to/config.json'

This provides power users full control over Claude's behavior without
waiting for specific inputs to be added to the action.
2025-08-07 14:01:27 -07:00
km-anthropic
36c720c2db prettify 2025-08-07 12:30:03 -07:00
km-anthropic
cc07dbfca7 fix: remove experimental-review mode reference from MCP config
The inline comment server configuration was checking for deprecated
'mode' field. Since review mode is removed in v1.0, this conditional
block is no longer needed.
2025-08-07 12:13:50 -07:00
km-anthropic
18bb01184d chore: remove unused js-yaml dependencies
These were added for slash-command YAML parsing but are no longer
needed since we removed slash-command preprocessing entirely
2025-08-07 12:12:05 -07:00
km-anthropic
1846b19826 Merge branch 'main' into v1-dev
Resolved conflict by keeping deletion of src/modes/review/index.ts
as review mode is removed in v1.0
2025-08-07 11:57:14 -07:00
km-anthropic
65896abe74 fix: address PR review comments for v1.0 simplification
- Remove duplicate prompt field spread (line 160)
- Remove async from generatePrompt since slash commands are handled by Claude Code
- Add detailed comment explaining why prompt → agent mode logic
- Remove entire slash-commands loader and directories as Claude Code handles natively
- Simplify prompt generation to just pass through to Claude Code

These changes align with v1.0 philosophy: GitHub Action is a thin wrapper
that delegates everything to Claude Code for native handling.
2025-08-07 11:50:58 -07:00