From 31ad68f096bf871ddf016961be71646686d00d40 Mon Sep 17 00:00:00 2001 From: kristianmills Date: Thu, 12 Dec 2024 09:58:43 -0800 Subject: [PATCH] Switching to slack-github-action 2.0 --- action.yml | 74 ++++++++++++++++++++---------------------------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/action.yml b/action.yml index 6588d13..ef26b27 100644 --- a/action.yml +++ b/action.yml @@ -73,51 +73,31 @@ runs: - name: Send notification if: always() - uses: archive/github-actions-slack@v2.9.0 + uses: slackapi/slack-github-action@v2.0.0 with: - slack-channel: ${{ inputs.channel }} - slack-bot-user-oauth-access-token: ${{ inputs.token }} - slack-optional-thread_ts: ${{ inputs.slack-ts }} - slack-blocks: >- - [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":${{ steps.fields.outputs.emoji }}: *Workflow ${{ inputs.status }}*" - } - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Repository*\n" - }, - { - "type": "mrkdwn", - "text": "*Environment/Branch*\n${{ inputs.environment || github.ref_name }}" - } - ] - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Author*\n" - }, - { - "type": "mrkdwn", - "text": "*Job*\n${{ github.job }}" - } - ] - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": '*Commit Message*\n${{ steps.fields.outputs.sanitized_message }}' - } - } - ] + method: chat.postMessage + token: ${{ inputs.token }} + payload: | + channel: ${{ inputs.channel }} + thread_ts: ${{ inputs.slack-ts }} + blocks: + - type: "section", + text: + type: "mrkdwn", + text: ":${{ steps.fields.outputs.emoji }}: *Workflow ${{ inputs.status }}*" + - type: "section", + fields: + - type: "mrkdwn", + text: "*Repository*\n" + - type: "mrkdwn", + text: "*Environment/Branch*\n${{ inputs.environment || github.ref_name }}" + - type: "section", + fields: + - type: "mrkdwn", + text: "*Author*\n" + - type: "mrkdwn", + text: "*Job*\n${{ github.job }}" + - type: "section", + text: + type: "mrkdwn", + text: '*Commit Message*\n${{ steps.fields.outputs.sanitized_message }}'