Compare commits

..

8 Commits

Author SHA1 Message Date
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
7 changed files with 12 additions and 8 deletions

View File

@@ -18,9 +18,9 @@ jobs:
fetch-depth: 1
- name: Auto review PR
uses: anthropics/claude-code-action@main
uses: anthropics/claude-code-action@v1-dev
with:
direct_prompt: |
prompt: |
Please review this PR. Look at the changes and provide thoughtful feedback on:
- Code quality and best practices
- Potential bugs or issues
@@ -30,4 +30,4 @@ jobs:
Be constructive and specific in your feedback. Give inline comments where applicable.
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_tools: "mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"
claude_args: "--allowedTools mcp__github-comment-server__create_pending_pull_request_review,mcp__github-comment-server__add_comment_to_pending_review,mcp__github-comment-server__submit_pending_pull_request_review,mcp__github-comment-server__get_pull_request_diff"

View File

@@ -1,6 +1,6 @@
![Claude Code Action responding to a comment](https://github.com/user-attachments/assets/1d60c2e9-82ed-4ee5-b749-f9e021c85f4d)
# Claude Code Action
# Claude Code Action - No Approval Test
A general-purpose [Claude Code](https://claude.ai/code) action for GitHub PRs and issues that can answer questions and implement code changes. This action listens for a trigger phrase in comments and activates Claude act on the request. It supports multiple authentication methods including Anthropic direct API, Amazon Bedrock, and Google Vertex AI.

View File

@@ -141,7 +141,7 @@ runs:
echo "Base-action dependencies installed"
cd -
# Install Claude Code globally
bun install -g @anthropic-ai/claude-code@1.0.73
bun install -g @anthropic-ai/claude-code@1.0.72
- name: Setup Network Restrictions
if: steps.prepare.outputs.contains_trigger == 'true' && inputs.experimental_allowed_domains != ''

View File

@@ -85,7 +85,7 @@ runs:
- name: Install Claude Code
shell: bash
run: bun install -g @anthropic-ai/claude-code@1.0.73
run: bun install -g @anthropic-ai/claude-code@1.0.72
- name: Run Claude Code Action
shell: bash

View File

@@ -56,6 +56,7 @@ async function run() {
mode,
githubToken,
});
core.setOutput("GITHUB_TOKEN", githubToken);
// MCP config is handled by individual modes (tag/agent) and included in their claude_args output

View File

@@ -39,8 +39,10 @@ export const agentMode: Mode = {
return false;
},
async prepare({ context }: ModeOptions): Promise<ModeResult> {
async prepare({ context, githubToken }: ModeOptions): Promise<ModeResult> {
// Agent mode handles automation events and any event with explicit prompts
console.log(`Agent mode: githubToken provided: ${!!githubToken}, length: ${githubToken?.length || 0}`);
// TODO: handle by createPrompt (similar to tag and review modes)
// Create prompt directory
@@ -72,7 +74,7 @@ export const agentMode: Mode = {
`${process.env.GITHUB_ACTION_PATH}/src/mcp/github-comment-server.ts`,
],
env: {
GITHUB_TOKEN: process.env.GITHUB_TOKEN || "",
GITHUB_TOKEN: githubToken || "",
REPO_OWNER: context.repository.owner,
REPO_NAME: context.repository.repo,
GITHUB_EVENT_NAME: process.env.GITHUB_EVENT_NAME || "",

View File

@@ -0,0 +1 @@
Custom prompt content