|
7 | 7 | types: [opened, closed, reopened, synchronize] |
8 | 8 | issue_comment: |
9 | 9 | types: [created] |
| 10 | + pull_request_review: |
| 11 | + types: [submitted] |
| 12 | + pull_request_review_comment: |
| 13 | + types: [created] |
10 | 14 |
|
11 | 15 | jobs: |
12 | 16 | notify: |
|
84 | 88 | }] |
85 | 89 | }' \ |
86 | 90 | ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 91 | +
|
| 92 | + # ---------------------------- |
| 93 | + # 리뷰 제출(Submit Review) 알림 |
| 94 | + # ---------------------------- |
| 95 | + - name: Send Review Submitted Notification |
| 96 | + if: github.event_name == 'pull_request_review' && github.event.action == 'submitted' |
| 97 | + run: | |
| 98 | + REVIEW_BODY=$(echo "${{ github.event.review.body }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g') |
| 99 | + curl -X POST -H "Content-Type: application/json" \ |
| 100 | + -d "{ |
| 101 | + \"username\": \"GitHub 리뷰 봇\", |
| 102 | + \"embeds\": [{ |
| 103 | + \"title\": \"New Review on PR #${{ github.event.pull_request.number }}\", |
| 104 | + \"description\": \"**${{ github.actor }}**님이 리뷰를 남겼습니다: \\n${REVIEW_BODY}\", |
| 105 | + \"url\": \"${{ github.event.review.html_url }}\", |
| 106 | + \"color\": 16776960 |
| 107 | + }] |
| 108 | + }" \ |
| 109 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 110 | +
|
| 111 | + # ------------------------- |
| 112 | + # 리뷰 댓글에 대한 답글 알림 |
| 113 | + # ------------------------- |
| 114 | + - name: Send Review Comment Notification |
| 115 | + if: github.event_name == 'pull_request_review_comment' && github.event.action == 'created' |
| 116 | + run: | |
| 117 | + COMMENT_BODY=$(echo "${{ github.event.comment.body }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g') |
| 118 | + curl -X POST -H "Content-Type: application/json" \ |
| 119 | + -d "{ |
| 120 | + \"username\": \"GitHub 댓글 봇\", |
| 121 | + \"embeds\": [{ |
| 122 | + \"title\": \"New Reply on PR #${{ github.event.pull_request.number }}\", |
| 123 | + \"description\": \"**${{ github.actor }}**님의 새 답글: \\n${COMMENT_BODY}\", |
| 124 | + \"url\": \"${{ github.event.comment.html_url }}\", |
| 125 | + \"color\": 15105570 |
| 126 | + }] |
| 127 | + }" \ |
| 128 | + ${{ secrets.DISCORD_WEBHOOK_URL }} |
0 commit comments