Description
When claude-code-action is triggered via @claude on a pull request that originates from a fork, the action fails because it tries to git fetch origin <branch-name> — but the branch only exists on the fork's remote, not on origin.
Steps to reproduce
- Set up the
claude.yml workflow per the README (trigger on issue_comment with @claude)
- Receive a PR from a fork (cross-repository PR)
- Tag
@claude in a comment on that PR
Error
This is an open PR, checking out PR branch...
PR #12: 1 commits, using fetch depth 20
fatal: couldn't find remote ref feat/add-archive-timestamp
Expected behavior
The action should detect that the PR is from a fork (isCrossRepository: true) and fetch from the fork's repository URL instead of origin.
The GitHub API provides all the necessary info:
{
"head": {
"ref": "feat/add-archive-timestamp",
"repo": {
"full_name": "hacdias/kipclip-appview",
"clone_url": "https://github.com/hacdias/kipclip-appview.git"
}
}
}
Context
Description
When
claude-code-actionis triggered via@claudeon a pull request that originates from a fork, the action fails because it tries togit fetch origin <branch-name>— but the branch only exists on the fork's remote, not onorigin.Steps to reproduce
claude.ymlworkflow per the README (trigger onissue_commentwith@claude)@claudein a comment on that PRError
Expected behavior
The action should detect that the PR is from a fork (
isCrossRepository: true) and fetch from the fork's repository URL instead oforigin.The GitHub API provides all the necessary info:
{ "head": { "ref": "feat/add-archive-timestamp", "repo": { "full_name": "hacdias/kipclip-appview", "clone_url": "https://github.com/hacdias/kipclip-appview.git" } } }Context
claude-code-review.ymlusingon: pull_request) works fine on the same fork PRclaude.ymlusingon: issue_comment) failsanthropics/claude-code-action@v1