File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 # If there is no existing comment, comment_id.txt will contain just a
4646 # newline (due to jq & gh behaviour). This will cause grep to fail, so
4747 # we catch that.
48- COMMENT_ID =$(grep -o '^[0-9]\+$' comment_id.txt || true)
48+ RAW_COMMENT_ID =$(grep -o '^[0-9]\+$' comment_id.txt || true)
4949
50- if [ $COMMENT_ID ]
50+ if [ $RAW_COMMENT_ID ]
5151 then
5252 # Fetch existing comment, and validate:
5353 # - comment belongs to the PR with number $PR_NUMBER
@@ -57,13 +57,13 @@ jobs:
5757 | select(.body | test(\"^${COMMENT_PREFIX}\")) \
5858 | select(.user.login == \"${COMMENT_AUTHOR}\") \
5959 | .id"
60- COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID }" | jq "${FILTER}")
60+ COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${RAW_COMMENT_ID }" | jq "${FILTER}")
6161 if [ $COMMENT_ID ]
6262 then
6363 # Update existing comment
6464 jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}" -X PATCH --input -
6565 else
66- echo "Comment ${COMMENT_ID } did not pass validations: not editing."
66+ echo "Comment ${RAW_COMMENT_ID } did not pass validations: not editing."
6767 fi
6868 else
6969 # Create new comment
You can’t perform that action at this time.
0 commit comments