Release 26.06.01.1 #947
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 PR Events | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - closed | |
| jobs: | |
| notify-discord: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Discord Notification | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| run: | | |
| PR_ACTION="${{ github.event.action }}" | |
| PR_URL="${{ github.event.pull_request.html_url }}" | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| PR_AUTHOR="${{ github.event.pull_request.user.login }}" | |
| PR_MERGED="${{ github.event.pull_request.merged }}" | |
| # PR 생성 알림 | |
| if [[ "$PR_ACTION" == "opened" ]]; then | |
| curl -X POST -H "Content-Type: application/json" \ | |
| -d '{ | |
| "content": "리뷰좀 해주십사...😥\n🔗 PR: '"$PR_URL"'\n📄 Title: '"$PR_TITLE"'\n👤 Author: '"$PR_AUTHOR"'" | |
| }' $DISCORD_WEBHOOK_URL | |
| # PR 머지 알림 | |
| elif [[ "$PR_ACTION" == "closed" && "$PR_MERGED" == "true" ]]; then | |
| curl -X POST -H "Content-Type: application/json" \ | |
| -d '{ | |
| "content": "$PR_AUTHOR 성장 + 10🔗 PR: '"$PR_URL"'\n📄 Title: '"$PR_TITLE"'\n👤 Author: '"$PR_AUTHOR"'" | |
| }' $DISCORD_WEBHOOK_URL | |
| fi |