File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 45
45
# If there is no existing comment, comment_id.txt will contain just a
46
46
# newline (due to jq & gh behaviour). This will cause grep to fail, so
47
47
# 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)
49
49
50
- if [ $COMMENT_ID ]
50
+ if [ $RAW_COMMENT_ID ]
51
51
then
52
52
# Fetch existing comment, and validate:
53
53
# - comment belongs to the PR with number $PR_NUMBER
@@ -57,13 +57,13 @@ jobs:
57
57
| select(.body | test(\"^${COMMENT_PREFIX}\")) \
58
58
| select(.user.login == \"${COMMENT_AUTHOR}\") \
59
59
| .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}")
61
61
if [ $COMMENT_ID ]
62
62
then
63
63
# Update existing comment
64
64
jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}" -X PATCH --input -
65
65
else
66
- echo "Comment ${COMMENT_ID } did not pass validations: not editing."
66
+ echo "Comment ${RAW_COMMENT_ID } did not pass validations: not editing."
67
67
fi
68
68
else
69
69
# Create new comment
You can’t perform that action at this time.
0 commit comments