anthropics / anthropics/claude-code-action
Branch creation fails with 404 errors due to forward slash URL encoding
- Lingua principale
- TypeScript
- Stelle
- 8.9k
- Fork
- 2.1k
- Merge medio
- 3g 9h
- PR unite (30g)
- 10
Descrizione
Bug Summary
The Claude Code GitHub Action (anthropics/claude-code-action@v1) consistently fails when processing @claude mentions in GitHub issues due to branch naming conflicts with GitHub's API. The action attempts to create branches with forward slashes that get URL-encoded to %2F, resulting in 404 errors from GitHub's REST API.
Environment Details
Repository: Public GitHub repository (tnussbeck-star/Roofie-)
GitHub App: Claude Code (properly installed with all required permissions)
Action Version: anthropics/claude-code-action@v1
Authentication: CLAUDE_CODE_OAUTH_TOKEN (properly configured)
Trigger: issue_comment with @claude mentions
Steps to Reproduce
Install Claude Code GitHub App on repository with full permissions
Configure workflow with claude.yml:
yamlname: Claude Code
on:
issue_comment:
types: [created]
jobs:
claude:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
id-token: write
steps:
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh issue edit:*),Bash(gh pr comment:*),Bash(gh search:*)"'
Set CLAUDE_CODE_OAUTH_TOKEN secret in repository settings
Create or comment on any issue mentioning @claude
Observe workflow failure in GitHub Actions
Expected Behavior
Claude should respond to @claude mentions in issue comments with analysis and feedback.
Actual Behavior
Workflow fails consistently with HTTP 404 errors during branch operations. The action attempts to create working branches with names like claude/issue-4-20250924-2130 but GitHub's API cannot handle the URL-encoded version claude%2Fissue-4-20250924-2130.
Error Logs
Error: Process completed with exit code 1.
Run bun run $(GITHUB_ACTION_PATH)/src/entrypoints/update-comment-link.ts
Fetching issue comment 3330786409
Successfully fetched as issue comment
GET /repos/tnussbeck-star/Roofie-/branches/claude%2Fissue-4-20250924-2130 - 404 with id 9C00:1E1FE5:4D24952:1152F96E:68D4231F in 119ms
Branch claude/issue-4-20250924-2130 does not exist remotely, no branch link will be added
GET /repos/tnussbeck-star/Roofie-/compare/master...claude%2Fissue-4-20250924-2130 - 404 with id 9C00:EF3C7:86CDAC0:1E4449D0:68D460BF in 161ms
Error checking for changes in branch: 11 | /**
HttpError: Not Found - https://docs.github.com/rest/commits/commits#compare-two-commits
status: 404,
request: {
method: "GET",
url: "https://api.github.com/repos/tnussbeck-star/Roofie-/compare/master...claude%2Fissue-4-20250924-2130",
headers: [Object ...],
request: [Object ...],
}
Repository Configuration Verified
GitHub App Permissions: Issues (Read & Write), Pull requests (Read & Write), Repository contents (Read), Metadata (Read) - ALL CONFIRMED
Branch Protection: No branch protection rules configured
Actions Settings: "Allow all actions and reusable workflows" enabled
Workflow Permissions: "Read and write permissions" enabled
Authentication: CLAUDE_CODE_OAUTH_TOKEN properly configured and verified
Troubleshooting Attempts Made
Verified all GitHub App permissions are correctly granted
Confirmed repository allows GitHub Actions and third-party access
Tested with multiple claude_args configurations
Removed and reinstalled GitHub App
Verified no branch protection rules blocking creation
Confirmed authentication is working (Claude successfully fetches issue comments)
Tested with simple requests to isolate complexity issues
Root Cause Analysis
The core issue appears to be in how the action generates branch names. When Claude creates a branch named claude/issue-4-20250924-2130, the forward slash gets URL-encoded to %2F in API calls: claude%2Fissue-4-20250924-2130. GitHub's REST API endpoints for branch operations do not properly handle URL-encoded forward slashes in branch names, resulting in consistent 404 responses.
Impact
This bug completely prevents the Claude Code GitHub Action from functioning for issue interactions. Users cannot use @claude mentions in issues, which is a core feature of the integration.
Suggested Fix
The action should either:
Use branch names without forward slashes (e.g., claude-issue-4-20250924-2130)
Properly decode branch names before making GitHub API calls
Provide an option to disable branch creation for simple responses that don't require working branches
Additional Context
This issue occurs regardless of repository configuration, permissions, or authentication method. The problem is reproducible across different repositories and setups, suggesting it's a fundamental issue with the action's branch naming strategy rather than user configuration.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.