Skip to content

claude-code-action fails to checkout fork PRs #962

@tijs

Description

@tijs

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

  1. Set up the claude.yml workflow per the README (trigger on issue_comment with @claude)
  2. Receive a PR from a fork (cross-repository PR)
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions