Skip to content

Commit 209cf5c

Browse files
authored
chore(workflows): updating new comment workflow (#1667)
Fixing issue when the new comment had multilines that resulted in multiple messages posted. This was done by calling toJson in order to escape special characters (such as line breaks)
1 parent 8b90af0 commit 209cf5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/issue_comment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ jobs:
2323
- name: Run webhook curl command
2424
env:
2525
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
26+
BODY: ${{toJson(github.event.comment.body)}}
2627
shell: bash
27-
run: echo "${{github.event.comment.body}}" | sed -e "s/[\`\'\"]/ /g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"comment":"{}", "commentUrl":"${{github.event.comment.html_url}}", "user":"${{github.event.comment.user.login}}"}'
28+
run: echo $BODY | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"comment":"{}", "commentUrl":"${{github.event.comment.html_url}}", "user":"${{github.event.comment.user.login}}"}'

0 commit comments

Comments
 (0)