mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2026-05-01 22:51:40 +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:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
pr_number=$(gh api \
|
# Get list of PR's associated to the commit that triggered the workflow run
|
||||||
-H "Accept: application/vnd.github+json" \
|
prs=$(gh api \
|
||||||
/repos/${{ github.event.pull_request.head.repo.full_name }}/commits/${{ github.event.workflow_run.head_sha }}/pulls \
|
-H "Accept: application/vnd.github+json" \
|
||||||
--jq '.[0].number')
|
/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
|
if [ -z "$pr_number" ]; then
|
||||||
echo "No pull request found for this workflow run"
|
echo "No pull request found for this workflow run"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue