feat : λμ€μ½λ webhook + ν΄λ‘λ.md μΆκ° #1
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: PR Label Notify | |
| on: | |
| pull_request: | |
| types: [labeled] | |
| repository_dispatch: | |
| types: [pr_notify] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Send Discord notification for PR label | |
| if: github.event_name == 'pull_request' && github.event.label.name == 'need_review' | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL || 'https://discord.com/api/webhooks/1457757557438550177/8WvnhSLYFfxGRpsDD_ExCONT41dNKhpxw78D6m66nxEkwVMsuTdXifHQXm0JT4Z7dNp2' }} | |
| run: | | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| PR_AUTHOR="${{ github.event.pull_request.user.login }}" | |
| PR_URL="${{ github.event.pull_request.html_url }}" | |
| REPO_NAME="${{ github.repository }}" | |
| curl -X POST "$DISCORD_WEBHOOK_URL" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "content": "λ¦¬λ·°κ° νμν©λλ€! @νλ‘ νΈ", | |
| "embeds": [{ | |
| "title": "PR #'"$PR_NUMBER"': '"$PR_TITLE"'", | |
| "description": "리뷰 μμ²μ΄ μμ΅λλ€", | |
| "url": "'"$PR_URL"'", | |
| "color": 3447003, | |
| "fields": [ | |
| { | |
| "name": "μμ±μ", | |
| "value": "'"$PR_AUTHOR"'", | |
| "inline": true | |
| }, | |
| { | |
| "name": "μ μ₯μ", | |
| "value": "'"$REPO_NAME"'", | |
| "inline": true | |
| } | |
| ], | |
| "footer": { | |
| "text": "GitHub Actions" | |
| }, | |
| "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'" | |
| }] | |
| }' | |
| - name: Send Discord notification for webhook | |
| if: github.event_name == 'repository_dispatch' | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL || 'https://discord.com/api/webhooks/1457757557438550177/8WvnhSLYFfxGRpsDD_ExCONT41dNKhpxw78D6m66nxEkwVMsuTdXifHQXm0JT4Z7dNp2' }} | |
| run: | | |
| MESSAGE="${{ github.event.client_payload.message || 'λ¦¬λ·°κ° νμν©λλ€! @νλ‘ νΈ' }}" | |
| curl -X POST "$DISCORD_WEBHOOK_URL" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"content\": \"$MESSAGE\"}" |