diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 374ecb0e63..116b41787d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -173,41 +173,31 @@ jobs: BLOCKSUITE_REPO_PATH: ${{ github.workspace }}/blocksuite - name: Post Failed event to a Slack channel id: failed-slack - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 if: ${{ always() && contains(needs.*.result, 'failure') }} with: - channel-id: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy failed `${{ github.event.inputs.flavor }}`>", - "type": "mrkdwn" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + channel: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }} + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy failed `${{ github.event.inputs.flavor }}`>" + blocks: + - type: section + text: + type: mrkdwn + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy failed `${{ github.event.inputs.flavor }}`>" - name: Post Cancel event to a Slack channel id: cancel-slack - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 if: ${{ always() && contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }} with: - channel-id: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }} + token: ${{ secrets.SLACK_BOT_TOKEN }} + method: chat.postMessage payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy cancelled `${{ github.event.inputs.flavor }}`>", - "type": "mrkdwn" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + channel: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }} + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy cancelled `${{ github.event.inputs.flavor }}`>" + blocks: + - type: section + text: + type: mrkdwn + text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Backend deploy cancelled `${{ github.event.inputs.flavor }}`>"