Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR 코드 분석 시 suggestion 태그를 위한 로직 추가 #744

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53faac0
ci: suggestion 라벨에 대한 슬랙 메시지 로직 추가
JJ503 Nov 9, 2023
4878c0a
ci: 여러 jobs를 하나의 jobs로 합침
JJ503 Nov 9, 2023
b8f8bde
ci: 슬랙 메시지 테스트를 위한 로직 수정
JJ503 Nov 9, 2023
82b7c9b
ci: 각 step의 조건 수정
JJ503 Nov 9, 2023
3fab6cc
ci: 아이디에 대한 로직 수정
JJ503 Nov 9, 2023
4100389
ci: step의 조건 수정
JJ503 Nov 9, 2023
24f435d
ci: step들의 조건 수정
JJ503 Nov 9, 2023
d8b5028
ci: 조건 수정
JJ503 Nov 9, 2023
86ce87d
ci: 검증 수정
JJ503 Nov 9, 2023
fad355e
ci: 조건 추가
JJ503 Nov 9, 2023
bc128cd
ci: 조건 수정
JJ503 Nov 9, 2023
31dc2b4
ci: 조건 수정
JJ503 Nov 9, 2023
054b177
ci: 테스트를 위한 수정
JJ503 Nov 9, 2023
488953c
ci: 조건 수정
JJ503 Nov 9, 2023
515cbdc
ci: id 네이밍 수정
JJ503 Nov 9, 2023
339af21
ci: 테스트 로직 추가
JJ503 Nov 9, 2023
13855a8
ci
JJ503 Nov 9, 2023
765a3cf
ci: 조건 수정
JJ503 Nov 9, 2023
9d88721
ci: 테스트 로직 제거
JJ503 Nov 9, 2023
7ae143b
ci: 누락된 설정 추가
JJ503 Nov 9, 2023
6991f8f
ci: 첫 pr 요청 시에만 메시지를 보내도록 수정
JJ503 Nov 9, 2023
00b62bb
ci: 제안 pr 슬랙 메시지 workflow 분리
JJ503 Nov 9, 2023
d92a349
ci: 기존 코드 롤백 및 suggestion 라벨 제외 조건 추가
JJ503 Nov 9, 2023
4ffd184
ci: 테스트를 위한 로직 수정
JJ503 Nov 9, 2023
9153acd
ci: 테스트를 위한 로직 수정
JJ503 Nov 9, 2023
4475f35
ci: 테스트를 위한 수정 사항 제거
JJ503 Nov 9, 2023
ac91b5f
ci: 테스트를 위한 수정 사항 제거
JJ503 Nov 9, 2023
9e988b9
ci: 슬랙 메시지 형식 수정 및 강제 실패 추가
JJ503 Dec 8, 2023
ed7f9fa
ci: 슬랙 channel 호출이 안 되는 문제 해결
JJ503 Dec 8, 2023
3dbe997
ci: 첫 pr 요청 시에만 슬랙 알림이 가도록 수정
JJ503 Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backend_pr_decorator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions: write-all

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'backend')
if: contains(github.event.pull_request.labels.*.name, 'backend') && !contains(github.event.pull_request.labels.*.name, 'suggestion')
runs-on: ubuntu-latest

steps:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/backend_suggestion_pr_decorator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 제안 PR 슬랙 메시지

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

permissions: write-all

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'backend') && contains(github.event.pull_request.labels.*.name, 'suggestion')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: set author slack id
id: author-slack
run: |
GIT_ID=${{ github.event.pull_request.user.login }}

if [ "$GIT_ID" == "apptie" ]; then
AUTHOR_NAME="${{ secrets.apptie_slack_display_name }}"
elif [ "$GIT_ID" == "swonny" ]; then
AUTHOR_NAME="${{ secrets.swonny_slack_display_name }}"
elif [ "$GIT_ID" == "JJ503" ]; then
AUTHOR_NAME="${{ secrets.JJ503_slack_display_name }}"
elif [ "$GIT_ID" == "kwonyj1022" ]; then
AUTHOR_NAME="${{ secrets.kwonyj1022_slack_display_name }}"
fi

echo "AUTHOR_NAME=${AUTHOR_NAME}" >> $GITHUB_OUTPUT

- name: slack suggestion notification
if: github.event.action != 'synchronize'
run: |
SLACK_MESSAGE='{"text":"제안 PR","blocks":[{"type":"section","text":{"type":"mrkdwn","text":">*제안 PR* \n>\n>*PR Author*\n>'
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>*리뷰어*\n>"
SLACK_MESSAGE+="<!channel>"
SLACK_MESSAGE+='"}}]}'

curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}"

- name: Force failure
run: exit 1
Loading