Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4d2370c
fix: skip comment update on workflow cancellation
Oct 14, 2025
04a053b
chore: sync with upstream anthropics/claude-code-action
nathanclevenger Oct 18, 2025
41123e6
fix: support pull_request.assigned action with track_progress
nathanclevenger Oct 19, 2025
08dd986
feat(bedrock): add AWS_BEARER_TOKEN_BEDROCK support for Bedrock API keys
nathanclevenger Oct 30, 2025
30e8f60
merge: integrate track_progress support for pull_request.assigned events
nathanclevenger Oct 30, 2025
212b1b9
feat: add exponential backoff retry for rate limit errors
nathanclevenger Oct 31, 2025
07cf46a
Merge pull request #1 from dot-do/feature/retry-on-rate-limit
nathanclevenger Oct 31, 2025
ce72cb0
feat: fallback to Anthropic API on AWS Bedrock rate limit
nathanclevenger Oct 31, 2025
13f3147
Merge pull request #2 from dot-do/feature/fallback-to-anthropic-on-ra…
nathanclevenger Oct 31, 2025
c801b2e
fix: delete progress comment when review is submitted
nathanclevenger Nov 1, 2025
a2e32d6
refactor: extract review detection to helper function with type guards
nathanclevenger Nov 1, 2025
d4042c6
Merge pull request #3 from dot-do/fix/delete-comment-when-review-subm…
nathanclevenger Nov 1, 2025
edb8e53
fix: handle null files data in PR fetcher
nathanclevenger Nov 2, 2025
b50aeb0
fix: ALWAYS try Bedrock first on each attempt, immediate Anthropic fa…
nathanclevenger Nov 2, 2025
690c9c2
Merge pull request #5 from dot-do/fix/reduce-anthropic-retry-delay
nathanclevenger Nov 2, 2025
35bb7ac
feat: route Claude API through claude-lb proxy for instant failover
nathanclevenger Nov 2, 2025
c566a2c
Merge pull request #6 from dot-do/fix/early-429-detection
nathanclevenger Nov 2, 2025
dd4d00c
Merge pull request #4 from dot-do/fix/handle-null-files-pagination
nathanclevenger Nov 2, 2025
029d172
feat: add HTTP proxy for secure pass-through authentication
nathanclevenger Nov 2, 2025
d3d06c1
Merge pull request #8 from dot-do/feature/proxy-auth-headers
nathanclevenger Nov 2, 2025
6fc8661
feat: add anthropic-only proxy mode with intelligent fallback (#9)
nathanclevenger Nov 3, 2025
aa25fcc
fix: move /health endpoint check before 404 response
nathanclevenger Nov 4, 2025
af6557d
fix: move /health endpoint check before 404 response (#10)
nathanclevenger Nov 4, 2025
0cabd93
fix: add idleTimeout and bedrock-only proxy mode (#11)
nathanclevenger Nov 4, 2025
a08b95f
refactor: simplify proxy server - require both API keys (#12)
nathanclevenger Nov 4, 2025
61074b1
fix: set idleTimeout to 255 (Bun max) instead of 300
nathanclevenger Nov 4, 2025
005f5b7
Sync fork with upstream v2.0.32 (#13)
nathanclevenger Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
Expand All @@ -24,7 +24,7 @@ jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v1
with:
Expand All @@ -39,7 +39,7 @@ jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: oven-sh/setup-bun@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
next_version: ${{ steps.next_version.outputs.next_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -116,7 +116,7 @@ jobs:
environment: production
steps:
- name: Checkout base-action repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: anthropics/claude-code-base-action
token: ${{ secrets.CLAUDE_CODE_BASE_ACTION_PAT }}
Expand Down
47 changes: 47 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## ⚠️ CRITICAL: Repository Context

This is a **FORK** of `anthropics/claude-code-action`. This repository is `dot-do/claude-code-action`.

### Pull Request Rules

**NEVER create PRs against `anthropics/claude-code-action`**

- ✅ **CORRECT**: Create PRs in `dot-do/claude-code-action` (this repository)
- ❌ **WRONG**: Create PRs in `anthropics/claude-code-action` (upstream)

When using `gh pr create`, ALWAYS specify the repository explicitly:

```bash
# CORRECT - Specify our fork explicitly
gh pr create --repo dot-do/claude-code-action --base main --title "..." --body "..."

# WRONG - Default behavior may target upstream
gh pr create --title "..." --body "..."
```

### Repository Structure

```
origin → https://github.com/dot-do/claude-code-action.git (OUR FORK)
upstream → https://github.com/anthropics/claude-code-action.git (UPSTREAM)
```

**Default behavior**: `gh pr create` targets the upstream repository when working in a fork. This is NOT what we want.

### Syncing with Upstream

To pull changes from upstream Anthropic repository:

```bash
git fetch upstream
git merge upstream/main
git push origin main
```

### Why This Matters

- **Upstream pollution**: Creating PRs in upstream confuses Anthropic maintainers
- **Wrong codebase**: Our fork has custom modifications specific to `.do` platform
- **Permission issues**: We don't have merge rights in upstream repository
- **Workflow disruption**: PRs in wrong repo waste time and create confusion

## Development Tools

- Runtime: Bun 1.2.11
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ runs:
VERTEX_REGION_CLAUDE_3_7_SONNET: ${{ env.VERTEX_REGION_CLAUDE_3_7_SONNET }}

- name: Update comment with job link
if: steps.prepare.outputs.contains_trigger == 'true' && steps.prepare.outputs.claude_comment_id && always()
if: steps.prepare.outputs.contains_trigger == 'true' && steps.prepare.outputs.claude_comment_id && !cancelled()
shell: bash
run: |
bun run ${GITHUB_ACTION_PATH}/src/entrypoints/update-comment-link.ts
Expand Down
45 changes: 24 additions & 21 deletions base-action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,32 @@ Add the following to your workflow file:

## Inputs

| Input | Description | Required | Default |
| ------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ---------------------------- |
| `prompt` | The prompt to send to Claude Code | No\* | '' |
| `prompt_file` | Path to a file containing the prompt to send to Claude Code | No\* | '' |
| `allowed_tools` | Comma-separated list of allowed tools for Claude Code to use | No | '' |
| `disallowed_tools` | Comma-separated list of disallowed tools that Claude Code cannot use | No | '' |
| `max_turns` | Maximum number of conversation turns (default: no limit) | No | '' |
| `mcp_config` | Path to the MCP configuration JSON file, or MCP configuration JSON string | No | '' |
| `settings` | Path to Claude Code settings JSON file, or settings JSON string | No | '' |
| `system_prompt` | Override system prompt | No | '' |
| `append_system_prompt` | Append to system prompt | No | '' |
| `claude_env` | Custom environment variables to pass to Claude Code execution (YAML multiline format) | No | '' |
| `model` | Model to use (provider-specific format required for Bedrock/Vertex) | No | 'claude-4-0-sonnet-20250219' |
| `anthropic_model` | DEPRECATED: Use 'model' instead | No | 'claude-4-0-sonnet-20250219' |
| `fallback_model` | Enable automatic fallback to specified model when default model is overloaded | No | '' |
| `anthropic_api_key` | Anthropic API key (required for direct Anthropic API) | No | '' |
| `claude_code_oauth_token` | Claude Code OAuth token (alternative to anthropic_api_key) | No | '' |
| `use_bedrock` | Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API | No | 'false' |
| `use_vertex` | Use Google Vertex AI with OIDC authentication instead of direct Anthropic API | No | 'false' |
| `use_node_cache` | Whether to use Node.js dependency caching (set to true only for Node.js projects with lock files) | No | 'false' |
| Input | Description | Required | Default |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------- |
| `prompt` | The prompt to send to Claude Code | No\* | '' |
| `prompt_file` | Path to a file containing the prompt to send to Claude Code | No\* | '' |
| `allowed_tools` | Comma-separated list of allowed tools for Claude Code to use | No | '' |
| `disallowed_tools` | Comma-separated list of disallowed tools that Claude Code cannot use | No | '' |
| `max_turns` | Maximum number of conversation turns (default: no limit) | No | '' |
| `mcp_config` | Path to the MCP configuration JSON file, or MCP configuration JSON string | No | '' |
| `settings` | Path to Claude Code settings JSON file, or settings JSON string | No | '' |
| `system_prompt` | Override system prompt | No | '' |
| `append_system_prompt` | Append to system prompt | No | '' |
| `claude_env` | Custom environment variables to pass to Claude Code execution (YAML multiline format) | No | '' |
| `model` | Model to use (provider-specific format required for Bedrock/Vertex) | No | 'claude-4-0-sonnet-20250219' |
| `anthropic_model` | DEPRECATED: Use 'model' instead | No | 'claude-4-0-sonnet-20250219' |
| `fallback_model` | Enable automatic fallback to specified model when default model is overloaded | No | '' |
| `anthropic_api_key` | Anthropic API key (required for direct Anthropic API) | No | '' |
| `claude_code_oauth_token` | Claude Code OAuth token (alternative to anthropic_api_key) | No | '' |
| `use_bedrock` | Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API | No | 'false' |
| `use_vertex` | Use Google Vertex AI with OIDC authentication instead of direct Anthropic API | No | 'false' |
| `use_node_cache` | Whether to use Node.js dependency caching (set to true only for Node.js projects with lock files) | No | 'false' |
| `show_full_output` | Show full JSON output (⚠️ May expose secrets - see [security docs](../docs/security.md#️-full-output-security-warning)) | No | 'false'\*\* |

\*Either `prompt` or `prompt_file` must be provided, but not both.

\*\*`show_full_output` is automatically enabled when GitHub Actions debug mode is active. See [security documentation](../docs/security.md#️-full-output-security-warning) for important security considerations.

## Outputs

| Output | Description |
Expand Down Expand Up @@ -336,7 +339,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion base-action/examples/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server:sha-7aced2b"
"ghcr.io/github/github-mcp-server:sha-23fa0dd"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
Expand Down
18 changes: 16 additions & 2 deletions base-action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@

import * as core from "@actions/core";
import { preparePrompt } from "./prepare-prompt";
import { runClaude } from "./run-claude";
import { runClaudeWithRetry } from "./run-claude";
import { setupClaudeCodeSettings } from "./setup-claude-code-settings";
import { validateEnvironmentVariables } from "./validate-env";
import { startProxyServer, getProxyUrl, shouldUseProxy } from "./proxy-server";

async function run() {
try {
validateEnvironmentVariables();

// Start local HTTP proxy server for claude-lb (supports multiple modes)
const proxyPort = await startProxyServer();

// Only route through proxy if credentials are available
if (shouldUseProxy()) {
process.env.ANTHROPIC_BASE_URL = getProxyUrl();
console.log(`\n🔀 Claude API requests routed through claude-lb proxy`);
console.log(` Benefits: Centralized monitoring, observability, and multi-provider failover`);
} else {
console.log(`\n⚡️ Using direct Anthropic API (no proxy)`);
console.log(` To enable monitoring, set ANTHROPIC_API_KEY in secrets`);
}

await setupClaudeCodeSettings(
process.env.INPUT_SETTINGS,
undefined, // homeDir
Expand All @@ -20,7 +34,7 @@ async function run() {
promptFile: process.env.INPUT_PROMPT_FILE || "",
});

await runClaude(promptConfig.path, {
await runClaudeWithRetry(promptConfig.path, {
claudeArgs: process.env.INPUT_CLAUDE_ARGS,
allowedTools: process.env.INPUT_ALLOWED_TOOLS,
disallowedTools: process.env.INPUT_DISALLOWED_TOOLS,
Expand Down
Loading