There was an error while loading. Please reload this page.
2 parents 35c7a09 + 85d048a commit e6fa040Copy full SHA for e6fa040
1 file changed
.github/workflows/warning-count-comment.yml
@@ -44,7 +44,14 @@ jobs:
44
45
- name: Resolve PR number
46
id: pr
47
- run: echo "num=$(gh api "repos/$REPO/commits/$HEAD_SHA/pulls" --jq '.[0].number')" >> "$GITHUB_OUTPUT"
+ run: |
48
+ num=$(gh api "repos/$REPO/pulls?state=open&per_page=100" \
49
+ --jq "map(select(.head.sha==\"$HEAD_SHA\"))[0].number")
50
+ if [ -z "$num" ]; then
51
+ echo "no open PR found with head $HEAD_SHA" >&2
52
+ exit 1
53
+ fi
54
+ echo "num=$num" >> "$GITHUB_OUTPUT"
55
56
- name: Post or update sticky comment
57
uses: marocchino/sticky-pull-request-comment@v2
0 commit comments