์ธ์ฆ ํ๋ฉด ์ฐ๋ฅด๊ธฐ ๊ธฐ๋ฅ & ์๋๊ฐ ๋จ๊ธด ๋์ ๋ฆฌ์ก์ ์ธํฐ๋ ์ ์ถ๊ฐ #447
Workflow file for this run
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: Discord PR Notifications | |
| on: | |
| pull_request: | |
| types: [review_requested, closed] | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| review-request-notify: | |
| if: github.event.action == 'review_requested' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Review Request Notification | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| REQUESTED_REVIEWER: ${{ github.event.requested_reviewer.login }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| case "$REQUESTED_REVIEWER" in | |
| "chanho0908"|"JoungPeto0908") | |
| DISCORD_MENTION="<@379613882001391626>" | |
| ;; | |
| "dogmania") | |
| DISCORD_MENTION="<@951268632770531399>" | |
| ;; | |
| *) | |
| DISCORD_MENTION="@$REQUESTED_REVIEWER" | |
| ;; | |
| esac | |
| curl -H "Content-Type: application/json" \ | |
| -X POST \ | |
| -d "{\"content\": \"$DISCORD_MENTION ๋ฆฌ๋ทฐ ์์ฒญ์ด ์์ด์! ๐\", \"embeds\": [{\"title\": \"#$PR_NUMBER $PR_TITLE\", \"url\": \"$PR_URL\", \"color\": 5814783}]}" \ | |
| $DISCORD_WEBHOOK | |
| review-completed-notify: | |
| if: | | |
| github.event_name == 'pull_request_review' && | |
| github.event.review.user.type != 'Bot' && | |
| github.event.review.user.login != github.event.pull_request.user.login && | |
| github.event.review.state != 'commented' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Review Completed Notification | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| REVIEWER: ${{ github.event.review.user.login }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| REVIEW_STATE: ${{ github.event.review.state }} | |
| run: | | |
| case "$AUTHOR" in | |
| "chanho0908"|"JoungPeto0908") | |
| AUTHOR_MENTION="<@379613882001391626>" | |
| ;; | |
| "dogmania") | |
| AUTHOR_MENTION="<@951268632770531399>" | |
| ;; | |
| *) | |
| AUTHOR_MENTION="@$AUTHOR" | |
| ;; | |
| esac | |
| case "$REVIEW_STATE" in | |
| "changes_requested") | |
| MESSAGE="์์ ์์ฒญ์ด ์์ต๋๋ค ๐ง" | |
| COLOR=15158332 | |
| ;; | |
| "commented") | |
| MESSAGE="๋ฆฌ๋ทฐ ์ฝ๋ฉํธ๊ฐ ๋ฌ๋ ธ์ต๋๋ค ๐ฌ" | |
| COLOR=10181046 | |
| ;; | |
| *) | |
| MESSAGE="๋ฆฌ๋ทฐ๊ฐ ์๋ฃ๋์์ต๋๋ค ๐" | |
| COLOR=5814783 | |
| ;; | |
| esac | |
| curl -H "Content-Type: application/json" \ | |
| -X POST \ | |
| -d "{\"content\": \"$AUTHOR_MENTION $MESSAGE\", \"embeds\": [{\"title\": \"#$PR_NUMBER $PR_TITLE\", \"url\": \"$PR_URL\", \"color\": $COLOR}]}" \ | |
| $DISCORD_WEBHOOK | |
| merge-notify: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Merge Notification | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| case "$AUTHOR" in | |
| "chanho0908"|"JoungPeto0908") | |
| AUTHOR_MENTION="<@379613882001391626>" | |
| ;; | |
| "dogmania") | |
| AUTHOR_MENTION="<@951268632770531399>" | |
| ;; | |
| *) | |
| AUTHOR_MENTION="@$AUTHOR" | |
| ;; | |
| esac | |
| curl -H "Content-Type: application/json" \ | |
| -X POST \ | |
| -d "{\"content\": \"๐ PR์ด ๋จธ์ง๋์์ต๋๋ค! $AUTHOR_MENTION\", \"embeds\": [{\"title\": \"#$PR_NUMBER $PR_TITLE\", \"url\": \"$PR_URL\", \"color\": 3066993}]}" \ | |
| $DISCORD_WEBHOOK |