Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ inputs:
github_token:
description: "GitHub token with repo and pull request permissions (optional if using GitHub App)"
required: false
github_dotcom_token:
description: "GitHub.com token for downloading dependencies (setup-bun). Required for GHES deployments to avoid rate limits. For GitHub.com deployments, falls back to the workflow's default token"
required: false
use_bedrock:
description: "Use Amazon Bedrock with OIDC authentication instead of direct Anthropic API"
required: false
Expand Down Expand Up @@ -159,7 +162,7 @@ runs:
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # https://github.com/oven-sh/setup-bun/releases/tag/v2.1.2
with:
bun-version: 1.3.6
token: ${{ inputs.github_token || github.token }}
token: ${{ inputs.github_dotcom_token || github.token }}

- name: Setup Custom Bun Path
if: inputs.path_to_bun_executable != ''
Expand Down
5 changes: 5 additions & 0 deletions base-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ inputs:
description: "Use Microsoft Foundry with OIDC authentication instead of direct Anthropic API"
required: false
default: "false"
github_dotcom_token:
description: "GitHub.com token for downloading dependencies (setup-bun). Required for GHES deployments to avoid rate limits. For GitHub.com deployments, falls back to the workflow's default token"
required: false
default: ""

use_node_cache:
description: "Whether to use Node.js dependency caching (set to true only for Node.js projects with lock files)"
Expand Down Expand Up @@ -100,6 +104,7 @@ runs:
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # https://github.com/oven-sh/setup-bun/releases/tag/v2.1.2
with:
bun-version: 1.3.6
token: ${{ inputs.github_dotcom_token || github.token }}

- name: Setup Custom Bun Path
if: inputs.path_to_bun_executable != ''
Expand Down
18 changes: 18 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ If you prefer to configure the app manually or need custom permissions:

For more information on creating GitHub Apps, see the [GitHub documentation](https://docs.github.com/en/apps/creating-github-apps).

### GitHub Enterprise Server (GHES) Setup

When running this action on GitHub Enterprise Server, you should provide a GitHub.com token separately to avoid rate limits when downloading dependencies:

1. Create a GitHub.com personal access token (classic) with no scopes (public access only)
2. Add it as a repository secret (e.g., `GITHUB_DOTCOM_TOKEN`)
3. Pass it to the action:

```yaml
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ steps.app-token.outputs.token }} # GHES token
github_dotcom_token: ${{ secrets.GITHUB_DOTCOM_TOKEN }} # GitHub.com token
```

**GitHub.com deployments:** You don't need to set `github_dotcom_token`, it automatically falls back to the workflow's default token.

## Security Best Practices

**⚠️ IMPORTANT: Never commit API keys directly to your repository! Always use GitHub Actions secrets.**
Expand Down
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
| `base_branch` | The base branch to use for creating new branches (e.g., 'main', 'develop') | No | - |
| `use_sticky_comment` | Use just one comment to deliver PR comments (only applies for pull_request event workflows) | No | `false` |
| `github_token` | GitHub token for Claude to operate with. **Only include this if you're connecting a custom GitHub app of your own!** | No | - |
| `github_dotcom_token` | GitHub.com token for downloading dependencies. Required for GHES deployments to avoid rate limits. Falls back to workflow token for GitHub.com | 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` |
| `assignee_trigger` | The assignee username that triggers the action (e.g. @claude). Only used for issue assignment | No | - |
Expand Down