ci(blocked_pr): fix comment action

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2025-03-12 20:01:29 -07:00
parent 79283fd744
commit 0474b03626
No known key found for this signature in database
GPG Key ID: E10E321EB160949B

View File

@ -51,6 +51,7 @@ runs:
data=$(
gh api graphql \
--paginate \
--slurp \
-f owner="$owner" \
-f repo="$repo" \
-F issue="$ISSUE_NUMBER" \
@ -90,16 +91,16 @@ runs:
}
}
' \
--jq '' | jq -c --arg comment_id "<!--(ID:$COMMENT_ID)-->" '
.[0].data.repository.issueOrPullRequest.id as $id |
[ .[].data.repository.issueOrPullRequest.comments.nodes[] ] as $data |
[ $data.[] | select(.body | startswith($comment_id)) ] as $id_comments |
if ($id_comments | length) > 0 then
{ "issueId": $id, "commentId": $id_comments[0].id }
else
{ "issueId": $id, "commentId": "" }
end
'
| jq -c --arg comment_id "<!--(ID:$COMMENT_ID)-->" '
.[0].data.repository.issueOrPullRequest.id as $id |
[ .[].data.repository.issueOrPullRequest.comments.nodes[] ] as $data |
[ $data.[] | select(.body | startswith($comment_id)) ] as $id_comments |
if ($id_comments | length) > 0 then
{ "issueId": $id, "commentId": $id_comments[0].id }
else
{ "issueId": $id, "commentId": "" }
end
'
)
echo "ISSUE_NODE_ID=$(jq -r '.issueId' <<< "$data")" >> "$GITHUB_ENV"
echo "COMMENT_NODE_ID=$(jq -r '.commentId' <<< "$data")" >> "$GITHUB_ENV"