[FEAT] 회원가입 입력 폼 #17
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 Notify - PR Approved | |
| on: | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| notify: | |
| if: github.event.review.state == 'approved' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check approval count and notify | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| PR_NUM: ${{ github.event.pull_request.number }} | |
| TITLE: ${{ github.event.pull_request.title }} | |
| URL: ${{ github.event.pull_request.html_url }} | |
| REPO: ${{ github.repository }} | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| run: | | |
| # 현재 PR의 approved 리뷰 수 카운트 | |
| APPROVAL_COUNT=$(curl -sS \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer $GH_TOKEN" \ | |
| "https://api.github.com/repos/$REPO/pulls/$PR_NUM/reviews" \ | |
| | jq '[.[] | select(.state == "APPROVED")] | length') | |
| echo "Current approvals: $APPROVAL_COUNT" | |
| # 1개가 됐을 때만 알림 (중복 방지) | |
| if [ "$APPROVAL_COUNT" -eq 1 ]; then | |
| # GitHub 유저네임 → Discord ID 매핑 | |
| case "$AUTHOR" in | |
| "kkhhmm3103") DISCORD_MENTION="<@1355211300501717145>" ;; | |
| "minseokim0113") DISCORD_MENTION="<@759420067980509225>" ;; | |
| "cl-o-lc") DISCORD_MENTION="<@1348158110488858628>" ;; | |
| "ochanhyeok") DISCORD_MENTION="<@396531387764834304>" ;; | |
| "gaeunnlee") DISCORD_MENTION="<@1061932517441163337>" ;; | |
| "hjh79gw") DISCORD_MENTION="<@947477999085813810>" ;; | |
| *) DISCORD_MENTION="@$AUTHOR" ;; | |
| esac | |
| MSG="✅ **PR 승인 완료!** $DISCORD_MENTION\n\n**#$PR_NUM $TITLE**\n$URL\n\n👉 머지 가능 상태입니다." | |
| curl -sS -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"content\":\"$MSG\"}" \ | |
| "$DISCORD_WEBHOOK_URL" | |
| fi |