mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2026-04-28 13:11:58 +00:00
find PR that matches the upstream
This commit is contained in:
parent
0215568d68
commit
c0a2b11e29
1 changed files with 7 additions and 4 deletions
11
.github/workflows/update-pr-artifacts.yml
vendored
11
.github/workflows/update-pr-artifacts.yml
vendored
|
|
@ -15,10 +15,13 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
pr_number=$(gh api \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.event.pull_request.head.repo.full_name }}/commits/${{ github.event.workflow_run.head_sha }}/pulls \
|
||||
--jq '.[0].number')
|
||||
# Get list of PR's associated to the commit that triggered the workflow run
|
||||
prs=$(gh api \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
/repos/${{ github.event.pull_request.head.repo.full_name }}/commits/${{ github.event.workflow_run.head_sha }}/pulls)
|
||||
|
||||
# Find the PR against the current repo
|
||||
pr_number=$(echo "$prs" | jq -r '.[] | select(.base.repo.full_name == "${{ github.repository }}") | .number' | head -n1)
|
||||
|
||||
if [ -z "$pr_number" ]; then
|
||||
echo "No pull request found for this workflow run"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue