Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/pr-review-companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading