Skip to content

Commit

Permalink
ci: �슬랙 메시지 형식 수정 및 강제 실패 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ503 authored Dec 8, 2023
1 parent ac91b5f commit 9e988b9
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/backend_suggestion_pr_decorator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 제안 PR 슬랙 메시지

on:
pull_request:
types: [ opened, reopened ]
types: [ opened, reopened, synchronize ]
branches: [ main, develop, develop-be ]

permissions: write-all
Expand All @@ -22,32 +22,29 @@ jobs:
if [ "$GIT_ID" == "apptie" ]; then
AUTHOR_NAME="${{ secrets.apptie_slack_display_name }}"
AUTHOR_ID="${{ secrets.apptie_slack_id }}"
elif [ "$GIT_ID" == "swonny" ]; then
AUTHOR_NAME="${{ secrets.swonny_slack_display_name }}"
AUTHOR_ID="${{ secrets.swonny_slack_id }}"
elif [ "$GIT_ID" == "JJ503" ]; then
AUTHOR_NAME="${{ secrets.JJ503_slack_display_name }}"
AUTHOR_ID="${{ secrets.JJ503_slack_id }}"
elif [ "$GIT_ID" == "kwonyj1022" ]; then
AUTHOR_NAME="${{ secrets.kwonyj1022_slack_display_name }}"
AUTHOR_ID="${{ secrets.kwonyj1022_slack_id }}"
fi
echo "AUTHOR_NAME=${AUTHOR_NAME}" >> $GITHUB_OUTPUT
echo "AUTHOR_ID=${AUTHOR_ID}" >> $GITHUB_OUTPUT
- name: slack suggestion notification
run: |
SLACK_MESSAGE='{"text":"제안 PR","blocks":[{"type":"section","text":{"type":"mrkdwn","text":">*제안 PR* \n>\n>*PR Author*\n>'
SLACK_MESSAGE+="<@"
SLACK_MESSAGE+="${{ steps.author-slack.outputs.AUTHOR_ID }}"
SLACK_MESSAGE+=">"
SLACK_MESSAGE+="${{ steps.author-slack.outputs.AUTHOR_NAME }}"
SLACK_MESSAGE+="\n>\n>*PR 링크*\n><"
SLACK_MESSAGE+="${{ github.event.pull_request.html_url }} "
SLACK_MESSAGE+="> \n>\n>*PR 제목*\n>"
SLACK_MESSAGE+="${{ github.event.pull_request.title }}"
SLACK_MESSAGE+="\n\n제안 사항에 대한 PR입니다.\n리뷰 요청은 스레드로 직접 멘션해주세요."
SLACK_MESSAGE+="\n>\n>*리뷰어*\n>"
SLACK_MESSAGE+="<@channel>"
SLACK_MESSAGE+='"}}]}'
curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}"
- name: Force failure
run: exit 1

0 comments on commit 9e988b9

Please sign in to comment.