chore: 운영 문서 docs 하위 이동 #378
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: Notify Slack When PR Is Opened | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| branches: | |
| - develop | |
| jobs: | |
| notify-slack: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get PR author and reviewers | |
| id: get_member_info | |
| run: | | |
| # PR 작성자 이름 추출 | |
| PR_AUTHOR_GITHUB_ID="${{ github.event.pull_request.user.login }}" | |
| PR_AUTHOR_NAME=$(jq -r --arg id "$PR_AUTHOR_GITHUB_ID" '.[$id].name // "알 수 없음"' .github/memberMap.json) | |
| echo "pr_author_name=$PR_AUTHOR_NAME" >> $GITHUB_OUTPUT | |
| # PR 작성자 제외한 멤버들의 slackId를 멘션으로 모으기 (slackId가 있는 경우만) | |
| MENTIONS=$(jq -r --arg author "$PR_AUTHOR_GITHUB_ID" ' | |
| to_entries | |
| | map(select(.key != $author and .value.slackId != null and .value.slackId != "")) | |
| | map("<@" + .value.slackId + ">") | |
| | join(" ") | |
| ' .github/memberMap.json) | |
| # 멘션이 없으면 빈 문자열로 설정 | |
| if [ -z "$MENTIONS" ] || [ "$MENTIONS" = "null" ]; then | |
| MENTIONS="" | |
| fi | |
| echo "reviewers_mention=$MENTIONS" >> $GITHUB_OUTPUT | |
| - name: Send Slack message | |
| uses: slackapi/slack-github-action@v2.1.0 | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.SLACK_FRONT_CHANNEL_ID }} | |
| text: "리뷰하러 가기 > <${{ github.event.pull_request.html_url }}|go>\n- PR 타이틀: ${{ github.event.pull_request.title }}\n- PR 작성자: ${{ steps.get_member_info.outputs.pr_author_name }}\n- 리뷰어: ${{ steps.get_member_info.outputs.reviewers_mention }}" | |
| unfurl_links: false | |
| unfurl_media: false |