File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ name: Notify Discord on `/noti` Comment
22
33on :
44 issue_comment :
5- types : [created]
5+ types : [ created ]
66
77jobs :
88 notify-on-noti-comment :
99 if : github.event.issue.pull_request
1010 runs-on : ubuntu-latest
11+ env :
12+ DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
1113 steps :
1214 - name : Check for `/noti` keyword and send Discord notification
1315 run : |
@@ -16,12 +18,12 @@ jobs:
1618 AUTHOR="${{ github.event.comment.user.login }}"
1719
1820 if echo "$COMMENT_BODY" | grep -q "/noti"; then
19- CONTENT="📣 알림 요청이 감지되었습니다!\n🔗 ${PR_URL} \n🙋 작성자: ${AUTHOR} \n💬 댓글: ${ COMMENT_BODY}"
21+ CONTENT=$(printf "📣 알림 요청이 감지되었습니다!\n🔗 %s \n🙋 작성자: %s \n💬 댓글: %s" "$PR_URL" "$AUTHOR" "$ COMMENT_BODY")
2022
2123 curl -H "Content-Type: application/json" \
2224 -X POST \
23- -d "{\" content\": \"${ CONTENT}\"} " \
24- ${{ secrets. DISCORD_WEBHOOK }}
25+ -d "$(jq -n --arg content "$ CONTENT" '{content: $content}') " \
26+ "$ DISCORD_WEBHOOK"
2527 else
2628 echo "No /noti found. Skipping notification."
2729 fi
You can’t perform that action at this time.
0 commit comments