Skip to content

[Refactor] 응원 등록 이미지 트랜잭션 분리 및 보상 트랜잭션 Prod 적용 #357

[Refactor] 응원 등록 이미지 트랜잭션 분리 및 보상 트랜잭션 Prod 적용

[Refactor] 응원 등록 이미지 트랜잭션 분리 및 보상 트랜잭션 Prod 적용 #357

name: Notify Discord on `/noti` Comment
on:
issue_comment:
types: [ created ]
jobs:
notify-on-noti-comment:
if: github.event.issue.pull_request
runs-on: ubuntu-latest
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
steps:
- name: Check for `/noti` keyword and send Discord notification
run: |
COMMENT_BODY="${{ github.event.comment.body }}"
PR_URL="https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}"
AUTHOR="${{ github.event.comment.user.login }}"
if echo "$COMMENT_BODY" | grep -q "/noti"; then
CONTENT=$(printf "📣 알림 요청이 감지되었습니다!\n🔗 %s\n🙋 작성자: %s\n💬 댓글: %s" "$PR_URL" "$AUTHOR" "$COMMENT_BODY")
curl -H "Content-Type: application/json" \
-X POST \
-d "$(jq -n --arg content "$CONTENT" '{content: $content}')" \
"$DISCORD_WEBHOOK"
else
echo "No /noti found. Skipping notification."
fi