From 0474b03626e6aff15630e4965fe73a5136d21ea0 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Wed, 12 Mar 2025 20:01:29 -0700 Subject: [PATCH] ci(blocked_pr): fix comment action Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- .github/actions/create-comment/action.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/actions/create-comment/action.yml b/.github/actions/create-comment/action.yml index 5ba4bc5c9..52b46d3b2 100644 --- a/.github/actions/create-comment/action.yml +++ b/.github/actions/create-comment/action.yml @@ -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 "" ' - .[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 "" ' + .[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"