Skip to content

ci(pr-review-companion): identify PR number from head repository#1258

Merged
LeoMcA merged 1 commit intomainfrom
fix-pr-review-companion
Jan 27, 2026
Merged

ci(pr-review-companion): identify PR number from head repository#1258
LeoMcA merged 1 commit intomainfrom
fix-pr-review-companion

Conversation

@caugner
Copy link
Contributor

@caugner caugner commented Jan 26, 2026

Description

Update the pr-review-companion workflow, identifying the PR number from the head repository instead of the base repository.

Motivation

The current approach fails to identify the PR number for fork PRs, because the commits API only returns commits in the given repo, excluding forks.

Additional details

Noticed in #1221 that the PR number was empty. And here's is the explanation:

$ gh api repos/mdn/fred/commits/56a905455f8be1a8d8194089c2cbaf2a0debd455/pulls
[]

$ gh api repos/mayank99/fred/commits/56a905455f8be1a8d8194089c2cbaf2a0debd455/pulls
[
  {
    "url": "https://api.github.com/repos/mdn/fred/pulls/1221",
    // …
    "number": 1221,
    // …
    "base": {
      // …
      "repo": {
        // …
        "full_name": "mdn/fred",
        // …
      }
    },
    // ...
  }
]

Related issues and pull requests

@caugner caugner requested a review from a team as a code owner January 26, 2026 22:01
@caugner caugner requested a review from LeoMcA January 26, 2026 22:01
@github-actions
Copy link
Contributor

449c88d was deployed to: https://fred-pr1258.review.mdn.allizom.net/

@LeoMcA LeoMcA merged commit 59bfd7e into main Jan 27, 2026
12 checks passed
@LeoMcA LeoMcA deleted the fix-pr-review-companion branch January 27, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants