Skip to content

[REFACTOR] 에러 바운더리 추가 #229

[REFACTOR] 에러 바운더리 추가

[REFACTOR] 에러 바운더리 추가 #229

Workflow file for this run

name: slack-notice-fe
on:
pull_request:
types: [ opened, closed ]
paths:
- "frontend/**"
jobs:
notify-slack:
runs-on: ubuntu-latest
steps:
- name: Build mention list
id: mention
shell: bash
run: |
AUTHOR="${{ github.event.pull_request.user.login }}"
MEMBERS=(
"bonsng:${{ secrets.BONSNG_SLACK_ID }}"
"rkdwoals159:${{ secrets.JAEMIN_SLACK_ID }}"
"yyoonngg:${{ secrets.YOUNGHYUN_SLACK_ID }}"
)
MENTIONS=""
for entry in "${MEMBERS[@]}"; do
NAME="${entry%%:*}"
ID="${entry##*:}"
if [ "$NAME" != "$AUTHOR" ]; then
MENTIONS="$MENTIONS <@$ID>"
fi
done
echo "mentions=$MENTIONS" >> "$GITHUB_OUTPUT"
- name: Notify Slack (PR opened)
if: github.event.action == 'opened'
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"link_names": true,
"text": "${{ steps.mention.outputs.mentions }}\n*🔔 새로운 Pull Request 생성*\n\n*📌 제목*\n${{ github.event.pull_request.title }}\n\n*👤 작성자*\n${{ github.event.pull_request.user.login }}\n\n*🌿 브랜치*\n${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\n\n👉 PR 바로가기\n${{ github.event.pull_request.html_url }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FE }}
- name: Notify Slack (PR merged)
if: github.event.action == 'closed' && github.event.pull_request.merged == true
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"link_names": true,
"text": "${{ steps.mention.outputs.mentions }}\n*✅ Pull Request 머지 완료*\n\n*📌 제목*\n${{ github.event.pull_request.title }}\n\n*👤 작성자*\n${{ github.event.pull_request.user.login }}\n\n*🌿 브랜치*\n${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}\n\n👉 PR 바로가기\n${{ github.event.pull_request.html_url }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FE }}