Skip to content

Commit 36542f3

Browse files
committed
chore: noti 입력데이터 수정
1 parent f85c23e commit 36542f3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/notify-discord-noti.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Notify Discord on `/noti` Comment
22

33
on:
44
issue_comment:
5-
types: [created]
5+
types: [ created ]
66

77
jobs:
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

0 commit comments

Comments
 (0)