Bug
When @claude is tagged on a PR that originates from a fork, the action fails with:
fatal: couldn't find remote ref <branch-name>
Root Cause
In src/modes/tag/index.ts / src/github/data/fetcher.ts, the action runs:
git fetch origin --depth=20 <branch-name>
For fork PRs, the branch only exists on the fork's remote, not on origin. GitHub exposes fork PR content at refs/pull/<number>/head, but the action doesn't use this ref.
Reproduction
- Have a repo with a PR from an external fork
- Comment
@claude on that PR
- Action crashes at the
git fetch step
Expected Behavior
The action should detect fork PRs and fetch using refs/pull/<number>/head instead of the branch name. For example:
git fetch origin "pull/${PR_NUMBER}/head:${BRANCH_NAME}"
Attempted Workarounds (all failed)
We tried pre-fetching the branch in a workflow step before the action runs:
- name: Pre-fetch fork PR branch
run: |
git fetch origin "pull/$PR_NUMBER/head:$HEAD_REF"
git fetch origin "pull/$PR_NUMBER/head:refs/remotes/origin/$HEAD_REF"
Both the local branch and refs/remotes/origin/<branch> are successfully created, but the action still explicitly runs git fetch origin --depth=20 <branch> which contacts the remote and fails because the branch name doesn't exist there.
Additional Issue
When the action crashes during this setup phase, it does not update the initial comment it created to indicate the failure. The comment remains in a "working" state permanently.
Environment
anthropics/claude-code-action@v1 (SHA: 1c8b699d43e9bfed42b48ef15da85d89bab70960)
- Using Vertex AI provider
- Triggered via
issue_comment event on a fork PR
Bug
When
@claudeis tagged on a PR that originates from a fork, the action fails with:Root Cause
In
src/modes/tag/index.ts/src/github/data/fetcher.ts, the action runs:For fork PRs, the branch only exists on the fork's remote, not on
origin. GitHub exposes fork PR content atrefs/pull/<number>/head, but the action doesn't use this ref.Reproduction
@claudeon that PRgit fetchstepExpected Behavior
The action should detect fork PRs and fetch using
refs/pull/<number>/headinstead of the branch name. For example:git fetch origin "pull/${PR_NUMBER}/head:${BRANCH_NAME}"Attempted Workarounds (all failed)
We tried pre-fetching the branch in a workflow step before the action runs:
Both the local branch and
refs/remotes/origin/<branch>are successfully created, but the action still explicitly runsgit fetch origin --depth=20 <branch>which contacts the remote and fails because the branch name doesn't exist there.Additional Issue
When the action crashes during this setup phase, it does not update the initial comment it created to indicate the failure. The comment remains in a "working" state permanently.
Environment
anthropics/claude-code-action@v1(SHA:1c8b699d43e9bfed42b48ef15da85d89bab70960)issue_commentevent on a fork PR