Skip to content

[bug]: PR info and CI checks not shown for fork branches #1643

@ubuntudroid

Description

@ubuntudroid

Bug Description

When working in a fork of the repository and a PR has been created from a fork branch against the main (upstream) repository, the PR info panel in the sidebar shows "No PR for this task" and the CI checks panel shows "No CI checks found for this repository".

Steps to Reproduce

  1. Fork the repository on GitHub
  2. Clone your fork locally and open it as a project in emdash
  3. Create a task/worktree branch, push it to your fork, and open a PR against the upstream repo
  4. Observe the sidebar for that task

Actual vs Expected Behavior

Actual: The sidebar shows "No PR for this task" and CI checks are empty, even though an open PR exists in the upstream repository.

Expected: The PR info (title, status, checks, etc.) is displayed correctly, as it is for PRs in non-fork repos.

Root cause: gh pr view exits with a non-zero code when run in a fork directory (the PR doesn't exist in the fork's own repo). The error was caught by an outer try/catch that immediately returned null, bypassing the branch-name and fork-detection fallbacks entirely. The fork detection fallback also had a bug where it tried to read parent.nameWithOwner from the gh repo view JSON output, but the actual structure is parent.owner.login + parent.name.

emdash Version

0.4.45

Operating System

macOS 25.4.0

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions