Skip to content

Commit 714b30b

Browse files
committed
handle-pr-push: look for the PR in the correct repo
Just like I just had to adjust for comments in `git/git` PRs in the previous commit, this fixes the same issue for pushes. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 3af47d5 commit 714b30b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/handle-pr-push.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ jobs:
5454
echo "text=$text" >> $GITHUB_OUTPUT
5555
5656
PR_NUMBER="${PR_URL##*/}" # skip the prefix before the PR number
57+
PR_REPO="${PR_URL%/pull/$PR_NUMBER*}" # skip the suffix including the PR number
58+
PR_REPO="${PR_REPO#https://*/}"
5759
5860
export GH_TOKEN="${{ secrets.GITHUB_TOKEN }}"
59-
eval "$(gh api repos/gitgitgadget/git/pulls/$PR_NUMBER \
61+
eval "$(gh api repos/$PR_REPO/pulls/$PR_NUMBER \
6062
--jq '"head_sha=\(.head.sha) && repo=\(.base.repo.full_name)"')"
6163
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
6264
echo "repo=$repo" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)