From 0a4c5b8f1a29c92774ea5fd5e8aaa91b74d118a0 Mon Sep 17 00:00:00 2001 From: Doeunnkimm Date: Tue, 25 Jun 2024 23:03:16 +0900 Subject: [PATCH] fix --- .github/workflows/slack-notify.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/slack-notify.yml b/.github/workflows/slack-notify.yml index 042f61d1..66f76ab7 100644 --- a/.github/workflows/slack-notify.yml +++ b/.github/workflows/slack-notify.yml @@ -33,11 +33,12 @@ jobs: run: | response=$(curl -X POST -H 'Content-type: application/json' --data '{ "text": "*πŸ§žβ€β™‚οΈ PR λ“œλ¦¬λŠ” μ§€λ‹ˆκ°€ μ™”μŠ΅λ‹ˆλ‹€~*\n*<${{ github.event.pull_request.html_url }}|[sambad#${{ github.event.pull_request.number }}] [${{ github.event.pull_request.title }}]>*\n${{ github.event.pull_request.user.login }}λ‹˜μ΄ μƒμ„±ν–ˆμ–΄μš”." - }' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }}) - echo "slack_ts=$(echo $response | jq -r '.ts')" >> $GITHUB_ENV + }' ${{ secrets.SLACK_WEBHOOK_URL }}) + slack_ts=$(echo $response | jq -r '.ts') + echo "slack_ts=$slack_ts" >> $GITHUB_ENV echo $slack_ts > slack_ts.txt env: - SLACK_BOT_ACCESS_TOKEN: ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Send notification for review request if: ${{ env.event_type == 'pull_request' && github.event.action == 'review_requested' }} @@ -47,14 +48,15 @@ jobs: if [ "$slack_username" != "null" ]; then response=$(curl -X POST -H 'Content-type: application/json' --data '{ "text": "*πŸ”” 리뷰 μš”μ²­μ΄ λ„μ°©ν–ˆμŠ΅λ‹ˆλ‹€*: @'$slack_username'" - }' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }}) - echo "slack_ts=$(echo $response | jq -r '.ts')" >> $GITHUB_ENV + }' ${{ secrets.SLACK_WEBHOOK_URL }}) + slack_ts=$(echo $response | jq -r '.ts') + echo "slack_ts=$slack_ts" >> $GITHUB_ENV echo $slack_ts > slack_ts.txt else echo "Reviewer not found in mapping: $reviewer" fi env: - SLACK_BOT_ACCESS_TOKEN: ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Restore Slack message timestamp if: ${{ env.event_type == 'issue_comment' || env.event_type == 'pull_request_review' }} @@ -79,12 +81,12 @@ jobs: curl -X POST -H 'Content-type: application/json' --data '{ "text": "@'$slack_username'λ‹˜μ΄ μ½”λ©˜νŠΈλ₯Ό λ‹¬μ•˜μŠ΅λ‹ˆλ‹€ πŸ’Œ:\n${{ github.event.comment.body }}", "thread_ts": "${{ env.SLACK_MESSAGE_TS }}" - }' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + }' ${{ secrets.SLACK_WEBHOOK_URL }} else echo "Commenter not found in mapping: $commenter" fi env: - SLACK_BOT_ACCESS_TOKEN: ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - name: Send notification for approval if: ${{ env.event_type == 'pull_request_review' && github.event.review.state == 'approved' && env.SLACK_MESSAGE_TS != '' }} @@ -95,9 +97,9 @@ jobs: curl -X POST -H 'Content-type: application/json' --data '{ "text": "βœ… @'$slack_username'λ‹˜μ΄ μŠΉμΈν•˜μ…¨μ–΄μš” πŸŽ‰", "thread_ts": "${{ env.SLACK_MESSAGE_TS }}" - }' ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + }' ${{ secrets.SLACK_WEBHOOK_URL }} else echo "Reviewer not found in mapping: $reviewer" fi env: - SLACK_BOT_ACCESS_TOKEN: ${{ secrets.SLACK_BOT_ACCESS_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}