[BOM-1171] feat: 마이페이지 챌린지 API #770
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 (PR-Request Changes) | |
| on: | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| notify-on-request-changes: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| ${{ | |
| github.event.review.state == 'changes_requested' && | |
| ( | |
| github.event.pull_request.base.ref == 'server-dev' || | |
| github.event.pull_request.base.ref == 'email-server-dev' || | |
| github.event.pull_request.base.ref == 'fcm-server' | |
| ) | |
| }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # notification_ids.json 기반으로 리뷰어/작성자 mention 변환 | |
| - name: Load user mapping | |
| id: load-users | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const fs = require("fs"); | |
| const mapping = JSON.parse(fs.readFileSync('.github/notification_ids.json', 'utf8')); | |
| const review = context.payload.review; | |
| const pr = context.payload.pull_request; | |
| const reviewer = review.user.login; | |
| const author = pr.user.login; | |
| const authorMention = mapping[author] ? `<@${mapping[author]}>` : author; | |
| console.log(`Reviewer: ${reviewer}`); | |
| console.log(`Author Mention: ${authorMention}`); | |
| core.setOutput("reviewer", reviewer); | |
| core.setOutput("authorMention", authorMention); | |
| # Discord 알림 전송 | |
| - name: Send Request Changes Notification | |
| uses: ./.github/actions/discord-notification | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK_PR }} | |
| content: "🚧 *수정 요청이 들어왔습니다!*" | |
| mentions: ${{ steps.load-users.outputs.authorMention }} | |
| title: ${{ github.event.pull_request.title }} | |
| url: ${{ github.event.pull_request.html_url }} | |
| color: 15158332 | |
| fields: | | |
| [ | |
| { "name": "리뷰어", "value": "${{ steps.load-users.outputs.reviewer }}" }, | |
| { "name": "상태", "value": "${{ github.event.review.state }}" } | |
| ] |