From 872e860278a915a849f17041803a9f85967a51e4 Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 18:03:32 +0900 Subject: [PATCH 01/34] Create slackPing.yml --- .github/workflows/slackPing.yml | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/slackPing.yml diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml new file mode 100644 index 00000000..b26eb128 --- /dev/null +++ b/.github/workflows/slackPing.yml @@ -0,0 +1,41 @@ +name: Slack Ping + +on: + pull_request: + types: + - review_requested + pull_request_review: + types: + - submitted + issue_comment: + types: + - created + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send Slack message + env: + SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} + SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }} + run: | + MESSAGE="" + SLACK_USER_ID="" + + if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]] && [[ "${{ github.event.requested_reviewer.login }}" == "YOUR_GITHUB_USERNAME" ]]; then + MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + + elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]] && [[ "${{ github.event.review.state }}" == "approved" ]] && [[ "${{ github.event.pull_request.user.login }}" == "YOUR_GITHUB_USERNAME" ]]; then + MESSAGE="리뷰 완료: 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + + elif [[ "${{ github.event_name }}" == "issue_comment" ]] && [[ "${{ github.event.issue.pull_request }}" != "null" ]] && [[ "${{ github.event.comment.user.login }}" != "YOUR_GITHUB_USERNAME" ]]; then + MESSAGE="댓글 알림: 내가 리뷰한 PR에 새로운 댓글이 달렸습니다. 제목: ${{ github.event.issue.title }} - 링크: ${{ github.event.comment.html_url }}" + + fi + + if [[ -n "$MESSAGE" ]]; then + curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ + -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ + https://slack.com/api/chat.postMessage + fi From a2af11b6cbcdcf7c55313c82dbd9af9738231f14 Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 20:54:03 +0900 Subject: [PATCH 02/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index b26eb128..89ff4137 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -2,8 +2,7 @@ name: Slack Ping on: pull_request: - types: - - review_requested + types: [opened, review_requested] pull_request_review: types: - submitted From 741eb4e444ddaa2ed189fa190b4aeccaa1f0351f Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:16:54 +0900 Subject: [PATCH 03/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 89ff4137..2fe5a120 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -21,15 +21,22 @@ jobs: run: | MESSAGE="" SLACK_USER_ID="" + + if [[ "${{ github.event.requested_reviewer.login }}" == "LURKS02" ]]; then + SLACK_USER_ID=$SLACK_USER_ID + fi + + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + MESSAGE="PR이 등록되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" - if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]] && [[ "${{ github.event.requested_reviewer.login }}" == "YOUR_GITHUB_USERNAME" ]]; then - MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then + # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" - elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]] && [[ "${{ github.event.review.state }}" == "approved" ]] && [[ "${{ github.event.pull_request.user.login }}" == "YOUR_GITHUB_USERNAME" ]]; then - MESSAGE="리뷰 완료: 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + # for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + # SLACK_USER_ID= - elif [[ "${{ github.event_name }}" == "issue_comment" ]] && [[ "${{ github.event.issue.pull_request }}" != "null" ]] && [[ "${{ github.event.comment.user.login }}" != "YOUR_GITHUB_USERNAME" ]]; then - MESSAGE="댓글 알림: 내가 리뷰한 PR에 새로운 댓글이 달렸습니다. 제목: ${{ github.event.issue.title }} - 링크: ${{ github.event.comment.html_url }}" + elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]]; then + MESSAGE="리뷰 완료(${{ github.event.review.state }}): 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" fi From 09877e64ea3ade30816e4e4b38a23918c457ab83 Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:22:26 +0900 Subject: [PATCH 04/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 2fe5a120..2846ed85 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -2,7 +2,8 @@ name: Slack Ping on: pull_request: - types: [opened, review_requested] + types: + - review_requested pull_request_review: types: - submitted @@ -32,7 +33,7 @@ jobs: # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" - # for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + # for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do # SLACK_USER_ID= elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]]; then From d1d04a9d8a8c1d6e000d1c1a8df4905609b21414 Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:27:45 +0900 Subject: [PATCH 05/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 2846ed85..85957461 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -30,14 +30,14 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]]; then MESSAGE="PR이 등록되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" - # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then + # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" # for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do # SLACK_USER_ID= elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]]; then - MESSAGE="리뷰 완료(${{ github.event.review.state }}): 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + MESSAGE="리뷰 완료("${{ github.event.review.state }}"): 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" fi From 23185b93131031720b58176457d9e903d656b16d Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:29:46 +0900 Subject: [PATCH 06/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 85957461..e700042d 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -3,7 +3,7 @@ name: Slack Ping on: pull_request: types: - - review_requested + - opened pull_request_review: types: - submitted From 97f4fc306d4b2fb2d10152478eeaadfd76dc7e8c Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:40:22 +0900 Subject: [PATCH 07/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index e700042d..506565f9 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -42,6 +42,8 @@ jobs: fi if [[ -n "$MESSAGE" ]]; then + echo "SLACK_USER_ID: $SLACK_USER_ID" + echo "SLACK_TOKEN: $SLACK_TOKEN" curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ https://slack.com/api/chat.postMessage From 62a12f708f0699e9717820b70231e4694befba20 Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:43:38 +0900 Subject: [PATCH 08/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 506565f9..e5e666f2 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -2,8 +2,7 @@ name: Slack Ping on: pull_request: - types: - - opened + types: [opened, edited, synchronize] pull_request_review: types: - submitted From 30815114f10f466de9cdc7d6e37ccc4e1937bb1a Mon Sep 17 00:00:00 2001 From: LURKS Date: Thu, 14 Nov 2024 23:53:15 +0900 Subject: [PATCH 09/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index e5e666f2..560f5b93 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -41,8 +41,8 @@ jobs: fi if [[ -n "$MESSAGE" ]]; then - echo "SLACK_USER_ID: $SLACK_USER_ID" - echo "SLACK_TOKEN: $SLACK_TOKEN" + echo "SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }}" + echo "SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}" curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ https://slack.com/api/chat.postMessage From b96ff697b3fd2eafb8440e5f0313b5400bbddf19 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:02:16 +0900 Subject: [PATCH 10/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 560f5b93..821859be 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -20,7 +20,6 @@ jobs: SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }} run: | MESSAGE="" - SLACK_USER_ID="" if [[ "${{ github.event.requested_reviewer.login }}" == "LURKS02" ]]; then SLACK_USER_ID=$SLACK_USER_ID From c20e60e47250e7d0edba3ccafeecc71c783cc7bf Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:22:47 +0900 Subject: [PATCH 11/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 821859be..cd730041 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + MESSAGE="PR이 등록되었습니다.\n\n${{ github.event.pull_request.title }}\n${{ github.event.pull_request.html_url }}" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" From 6d8c9a310163e01b37de04b82e6dc67ead2443dc Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:24:35 +0900 Subject: [PATCH 12/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index cd730041..246cee7a 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n\n${{ github.event.pull_request.title }}\n${{ github.event.pull_request.html_url }}" + MESSAGE="PR이 등록되었습니다.\n - 제목: ${{ github.event.pull_request.title }} \n - 링크: ${{ github.event.pull_request.html_url }}" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" From 3665e08db16b90357f7a9fb3e8064f3ca49ae521 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:28:03 +0900 Subject: [PATCH 13/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 246cee7a..d815cb0c 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -2,7 +2,7 @@ name: Slack Ping on: pull_request: - types: [opened, edited, synchronize] + types: [opened, edited] pull_request_review: types: - submitted @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n - 제목: ${{ github.event.pull_request.title }} \n - 링크: ${{ github.event.pull_request.html_url }}" + MESSAGE="PR이 등록되었습니다.\n - 제목: ${{ github.event.pull_request.title }}\n - 링크: <${{ github.event.pull_request.html_url }}|PR 링크>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" From 282b33c9a7cbca93bb267c16c03a8fa3dfe823b6 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:30:57 +0900 Subject: [PATCH 14/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index d815cb0c..f7047047 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n - 제목: ${{ github.event.pull_request.title }}\n - 링크: <${{ github.event.pull_request.html_url }}|PR 링크>" + MESSAGE="PR이 등록되었습니다. (링크: ${{ github.event.pull_request.html_url }})" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" From bcdc1dc1106eb4bb813b1d0815a0d71ca81b8935 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:32:57 +0900 Subject: [PATCH 15/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index f7047047..0a34401a 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -29,7 +29,7 @@ jobs: MESSAGE="PR이 등록되었습니다. (링크: ${{ github.event.pull_request.html_url }})" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then - # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" # for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do # SLACK_USER_ID= From 164bbb5480309f2346d65976b76335e1c76f9c82 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:33:59 +0900 Subject: [PATCH 16/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 0a34401a..234a7987 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다. (링크: ${{ github.event.pull_request.html_url }})" + MESSAGE="PR이 등록되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From bd572e69f68e8277d8d0617b6be604faf5267a1f Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:35:41 +0900 Subject: [PATCH 17/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 234a7987..f1f9a17a 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" + MESSAGE="PR이 등록되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From a61eb26e308d6d5e2b9bf37765c7337e43d0baf7 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:46:12 +0900 Subject: [PATCH 18/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index f1f9a17a..b222c362 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" + MESSAGE="PR이 등록되었습니다. - 링크: <${{ github.event.pull_request.html_url }}>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From 9fdf819fe1e6264d5175d18f709b28faa8e55f1d Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:47:26 +0900 Subject: [PATCH 19/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index b222c362..04d5d358 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다. - 링크: <${{ github.event.pull_request.html_url }}>" + MESSAGE="PR이 등록되었습니다.\n - 링크: <${{ github.event.pull_request.html_url }}>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From c779bc676f5ef4d0454553da2bced65225685121 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:48:51 +0900 Subject: [PATCH 20/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 04d5d358..bc9a328d 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n - 링크: <${{ github.event.pull_request.html_url }}>" + MESSAGE="PR이 등록되었습니다.\n\n - 링크: <${{ github.event.pull_request.html_url }}>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From b2e7f4da38490ce3e5e8345db8564a141c3973e3 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:56:56 +0900 Subject: [PATCH 21/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index bc9a328d..c2564baf 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n\n - 링크: <${{ github.event.pull_request.html_url }}>" + MESSAGE="PR이 등록되었습니다.\n :arrow_right:<${{ github.event.pull_request.html_url }}|PR 링크>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From 6f665508d922537661aaad1681feb797ba230e72 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 00:59:11 +0900 Subject: [PATCH 22/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index c2564baf..b8a96a29 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,7 +26,7 @@ jobs: fi if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n :arrow_right:<${{ github.event.pull_request.html_url }}|PR 링크>" + MESSAGE="PR이 등록되었습니다.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" From 176b7fd8369b7a42d7cc339ca6ca7b707478310d Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 01:36:01 +0900 Subject: [PATCH 23/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 66 +++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index b8a96a29..7fc8270f 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -2,47 +2,59 @@ name: Slack Ping on: pull_request: - types: [opened, edited] + types: + - review_requested pull_request_review: types: - submitted - issue_comment: - types: - - created jobs: notify: runs-on: ubuntu-latest steps: - - name: Send Slack message + - name: PR message env: SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} - SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }} run: | + declare -A USER_SLACK_IDS + USER_SLACK_IDS["LURKS02"]="${{ secrets.SLACK_USER_ID }}" + MESSAGE="" - if [[ "${{ github.event.requested_reviewer.login }}" == "LURKS02" ]]; then - SLACK_USER_ID=$SLACK_USER_ID - fi - - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - MESSAGE="PR이 등록되었습니다.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - - # if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "opened" ]]; then - # MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었습니다.\n링크: '${{ github.event.pull_request.html_url }}'" + if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then + MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었어요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - # for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do - # SLACK_USER_ID= + for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do + SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" + if [[ -n "$SLACK_USER_ID" ]]; then + curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ + -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ + https://slack.com/api/chat.postMessage + else + echo "'$GITHUB_USER'에 해당하는 슬랙 ID를 찾지 못했습니다." + fi + done elif [[ "${{ github.event_name }}" == "pull_request_review" ]] && [[ "${{ github.event.action }}" == "submitted" ]]; then - MESSAGE="리뷰 완료("${{ github.event.review.state }}"): 내 PR에 리뷰어가 리뷰를 완료했습니다. 제목: ${{ github.event.pull_request.title }} - 링크: ${{ github.event.pull_request.html_url }}" - - fi - - if [[ -n "$MESSAGE" ]]; then - echo "SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }}" - echo "SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}" - curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ - -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ - https://slack.com/api/chat.postMessage + GITHUB_USER="${{ github.event.pull_request.user.login }}" + SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" + REVIEW_STATE="${{ github.event.review.state }}" + + if [[ "$REVIEW_STATE" == "approved" ]]; then + STATE_MESSAGE="리뷰 완료 :white_check_mark:: PR이 승인되었습니다." + elif [[ "$REVIEW_STATE" == "changes_requested" ]]; then + STATE_MESSAGE="리뷰 완료 :warning:: PR에 변경 요청이 있습니다." + else + STATE_MESSAGE="리뷰 완료 :speech_balloon:: PR에 코멘트가 추가되었습니다." + fi + + MESSAGE="${STATE_MESSAGE}\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" + + if [[ -n "$SLACK_USER_ID" ]]; then + curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ + -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ + https://slack.com/api/chat.postMessage + else + echo "'$GITHUB_USER'에 해당하는 슬랙 ID를 찾지 못했습니다." + fi fi From 265b811236d414a45f721f0df14686965903d64b Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 01:37:35 +0900 Subject: [PATCH 24/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 7fc8270f..96901eee 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -17,7 +17,7 @@ jobs: SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} run: | declare -A USER_SLACK_IDS - USER_SLACK_IDS["LURKS02"]="${{ secrets.SLACK_USER_ID }}" + USER_SLACK_IDS["LURKS02"]="${{ secrets.SLACK_LURKS02 }}" MESSAGE="" From 3a99671035f11f0ee88a68287bc017792a072455 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 01:42:49 +0900 Subject: [PATCH 25/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 96901eee..09556f4e 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -24,7 +24,7 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었어요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo "${{ toJson(github.event.pull_request.requested_reviewers) }}" | jq -r '.[].login'); do + for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ From 483377730359adc106ae7625f9578ac753faaabd Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 01:58:28 +0900 Subject: [PATCH 26/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 09556f4e..522fc1c6 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -4,6 +4,7 @@ on: pull_request: types: - review_requested + - synchronize pull_request_review: types: - submitted @@ -41,11 +42,11 @@ jobs: REVIEW_STATE="${{ github.event.review.state }}" if [[ "$REVIEW_STATE" == "approved" ]]; then - STATE_MESSAGE="리뷰 완료 :white_check_mark:: PR이 승인되었습니다." + STATE_MESSAGE="리뷰 완료 :white_check_mark:: PR이 승인되었어요! :partying_face:" elif [[ "$REVIEW_STATE" == "changes_requested" ]]; then - STATE_MESSAGE="리뷰 완료 :warning:: PR에 변경 요청이 있습니다." + STATE_MESSAGE="리뷰 완료 :warning:: PR에 변경 요청이 있어요." else - STATE_MESSAGE="리뷰 완료 :speech_balloon:: PR에 코멘트가 추가되었습니다." + STATE_MESSAGE="리뷰 완료 :speech_balloon:: PR에 코멘트가 추가되었어요." fi MESSAGE="${STATE_MESSAGE}\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" @@ -57,4 +58,18 @@ jobs: else echo "'$GITHUB_USER'에 해당하는 슬랙 ID를 찾지 못했습니다." fi + + elif [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "synchronize" ]]; then + MESSAGE="커밋 추가: PR에 새로운 커밋이 추가되었어요. 리뷰 요청 사항이 반영되었는지 확인해보세요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" + + for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" + if [[ -n "$SLACK_USER_ID" ]]; then + curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ + -d "{\"channel\":\"$SLACK_USER_ID\", \"text\":\"$MESSAGE\"}" \ + https://slack.com/api/chat.postMessage + else + echo "'$GITHUB_USER'에 해당하는 슬랙 ID를 찾지 못했습니다." + fi + done fi From e455e11944145e76e7ec72ecbdb25ab21e5fc49f Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 18:54:09 +0900 Subject: [PATCH 27/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 522fc1c6..f2b93d84 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -19,6 +19,7 @@ jobs: run: | declare -A USER_SLACK_IDS USER_SLACK_IDS["LURKS02"]="${{ secrets.SLACK_LURKS02 }}" + USER_SLACK_IDS["051198Hz"]="${{ secrets.SLACK_051198HZ }}" MESSAGE="" From c33bf14e2d574a58586a93d1c4a77ef6e9d0c74e Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:13:33 +0900 Subject: [PATCH 28/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index f2b93d84..a849a4ea 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -13,6 +13,9 @@ jobs: notify: runs-on: ubuntu-latest steps: + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq + - name: PR message env: SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} @@ -62,7 +65,9 @@ jobs: elif [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "synchronize" ]]; then MESSAGE="커밋 추가: PR에 새로운 커밋이 추가되었어요. 리뷰 요청 사항이 반영되었는지 확인해보세요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - + + echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' + echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then From 5a5b8533696e226ba809574737579326d400b6c7 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:27:52 +0900 Subject: [PATCH 29/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index a849a4ea..b7b4535a 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -29,7 +29,7 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었어요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + for GITHUB_USER in $(echo '>>>${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ @@ -65,9 +65,6 @@ jobs: elif [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "synchronize" ]]; then MESSAGE="커밋 추가: PR에 새로운 커밋이 추가되었어요. 리뷰 요청 사항이 반영되었는지 확인해보세요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - - echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' - echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then From 805a783f42a5866b38e72dfefb9558282a16ed31 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:34:34 +0900 Subject: [PATCH 30/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index b7b4535a..53b3e930 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -15,6 +15,9 @@ jobs: steps: - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq + + - name: Debug PR event data + run: echo '${{ toJson(github.event.pull_request) }}' - name: PR message env: From da01e8be93bb1023a3c47a473126dbede8ad28ae Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:40:07 +0900 Subject: [PATCH 31/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 53b3e930..0f84dd64 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -16,8 +16,8 @@ jobs: - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - - name: Debug PR event data - run: echo '${{ toJson(github.event.pull_request) }}' + - name: Debug requested reviewers + run: echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' - name: PR message env: From 2fdb98145393aa2b2ec4b6c0714d2bd7505b8bd8 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:42:29 +0900 Subject: [PATCH 32/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 0f84dd64..9e70a0b9 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -32,7 +32,7 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었어요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo '>>>${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + for GITHUB_USER in $(echo '>>>${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[0][] | .login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ @@ -68,7 +68,7 @@ jobs: elif [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "synchronize" ]]; then MESSAGE="커밋 추가: PR에 새로운 커밋이 추가되었어요. 리뷰 요청 사항이 반영되었는지 확인해보세요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login'); do + for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[0][] | .login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ From 70de965dc03fd7b3f210fe82a188262e00119cd5 Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:48:49 +0900 Subject: [PATCH 33/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 9e70a0b9..25129f32 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -32,7 +32,7 @@ jobs: if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "review_requested" ]]; then MESSAGE="리뷰 요청: 나를 리뷰어로 지정한 PR이 생성되었어요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo '>>>${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[0][] | .login'); do + for GITHUB_USER in $(echo '>>>${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[] | .login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ @@ -68,7 +68,7 @@ jobs: elif [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.action }}" == "synchronize" ]]; then MESSAGE="커밋 추가: PR에 새로운 커밋이 추가되었어요. 리뷰 요청 사항이 반영되었는지 확인해보세요.\n :arrow_right: <${{ github.event.pull_request.html_url }}|PR 링크>" - for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[0][] | .login'); do + for GITHUB_USER in $(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[] | .login'); do SLACK_USER_ID="${USER_SLACK_IDS[$GITHUB_USER]}" if [[ -n "$SLACK_USER_ID" ]]; then curl -X POST -H "Authorization: Bearer $SLACK_TOKEN" -H "Content-Type: application/json" \ From 09ad056ec7ce9c962f7f0a6085398caf869da6ed Mon Sep 17 00:00:00 2001 From: LURKS Date: Fri, 15 Nov 2024 19:54:52 +0900 Subject: [PATCH 34/34] Update slackPing.yml --- .github/workflows/slackPing.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/slackPing.yml b/.github/workflows/slackPing.yml index 25129f32..f5c37c99 100644 --- a/.github/workflows/slackPing.yml +++ b/.github/workflows/slackPing.yml @@ -26,6 +26,8 @@ jobs: declare -A USER_SLACK_IDS USER_SLACK_IDS["LURKS02"]="${{ secrets.SLACK_LURKS02 }}" USER_SLACK_IDS["051198Hz"]="${{ secrets.SLACK_051198HZ }}" + USER_SLACK_IDS["around-forest"]="${{ secrets.SLACK_AROUNDFOREST }}" + USER_SLACK_IDS["jungseokyoung-cloud"]="${{ secrets.SLACK_JUNGSEOKYOUNGCLOUD }}" MESSAGE=""