anthropics / anthropics/claude-code-action

Claude Code Action fails when called from PR comments with non-ASCII branch names

未关闭
#616 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug p2 provider:bedrock
主要语言
TypeScript
星标
8.9k
派生
2.1k
平均合并
3 天 9 小时
30 天内合并 PR
10

描述

**Describe the bug**
When calling Claude Code Actions via PR comments with Japanese (non-ASCII characters) in branch names, it fails with the error "fatal: depth ?\_\_bunstr_0 is not a positive number".

**To Reproduce**
Steps to reproduce the behavior:

1. Create a PR with a branch containing non-ASCII characters as either source or target branch (e.g., feature/テスト)
2. Call Claude Code Action via PR comment
3. Receive a comment response: "Claude encountered an error —— View job Failed with exit code 128"
4. In the job detail, it fails with the error: "fatal: depth ?\_\_bunstr_0 is not a positive number Error: Prepare step failed with error: Failed with exit code 128 Error: Process completed with exit code 1."

**Expected behavior**
Claude Code Action should successfully handle branch names containing non-ASCII characters.

**Screenshots**
branch:

Image

PR comment:

Image

Job detail:

Image

**Workflow yml file**

```
name: Claude Assistant

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude-response:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
actions: read

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

- name: Configure AWS Credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ap-northeast-1

- name: Run Claude Code Action
uses: anthropics/claude-code-action@v1
with:
use_bedrock: "true"
claude_args: |
--model apac.anthropic.claude-sonnet-4-20250514-v1:0
--allowedTools Edit,Read,Write

```

**API Provider**

[ ] Anthropic First-Party API (default)
[×] AWS Bedrock
[ ] GCP Vertex

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。