From bc0496637b076af65305bbef38694cb1f95e7111 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Mon, 26 Jan 2026 22:38:59 +0100 Subject: [PATCH] ci(pr-review-companion): identify PR number from head repository --- .github/workflows/pr-review-companion.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-review-companion.yml b/.github/workflows/pr-review-companion.yml index 7a7128cef..0eb87bb65 100644 --- a/.github/workflows/pr-review-companion.yml +++ b/.github/workflows/pr-review-companion.yml @@ -25,13 +25,17 @@ jobs: - name: Identify PR id: identify-pr run: | - PR_NUMBER=$(gh api repos/${{ github.repository }}/commits/${{ github.event.workflow_run.head_sha }}/pulls --jq '.[0].number') + PR_NUMBER=$(gh api "repos/$HEAD_REPO/commits/$HEAD_SHA/pulls" --jq ".[] | select(.base.repo.full_name == \"$BASE_REPO\") | .number") echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT env: + BASE_REPO: ${{ github.repository }} GITHUB_TOKEN: ${{ github.token }} + HEAD_REPO: ${{ github.event.workflow_run.head_repository.full_name }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} deploy: needs: identify-pr + if: needs.identify-pr.outputs.pr-number uses: ./.github/workflows/_deploy.yml secrets: inherit with: @@ -42,6 +46,7 @@ jobs: comment: needs: [identify-pr, deploy] + if: needs.identify-pr.outputs.pr-number runs-on: ubuntu-latest steps: - name: Comment in PR