[Refactor] 응원 등록 이미지 트랜잭션 분리 및 보상 트랜잭션 Prod 적용 #357
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |