diff --git a/.github/actions/slack/action.yml b/.github/actions/slack/action.yml index a4ed1b4..2de9638 100644 --- a/.github/actions/slack/action.yml +++ b/.github/actions/slack/action.yml @@ -16,9 +16,28 @@ inputs: runs: using: "composite" steps: + # - id: prepare_payload + # run: | + # PAYLOAD="{\"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"${{ inputs.message }}\"}}]}" + # echo "PAYLOAD=$PAYLOAD" >> $GITHUB_ENV + # shell: bash + - uses: slackapi/slack-github-action@v1.26.0 env: SLACK_BOT_TOKEN: ${{ inputs.token }} with: channel-id: ${{ inputs.channel }} - slack-message: ${{ inputs.message }} + payload: "{\"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"${{ inputs.message }}\"}}]}" + # slack-message: ${{ inputs.message }} + # payload: | + # { + # "blocks": [ + # { + # "type": "section", + # "text": { + # "type": "mrkdwn", + # "text": "${{ env.MESSAGE }}" + # } + # } + # ] + # } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce12e7d..cc79e48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: name: Notify success uses: ./.github/actions/slack with: - message: | + message: |- :github-check: [Test passed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})! ${{ github.ref_type }}: ${{ github.ref_name }} Commit SHA: ${{ github.sha }} @@ -63,7 +63,7 @@ jobs: uses: ./.github/actions/slack name: Notify failure with: - message: | + message: |- :red-light: [Test failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})! ${{ github.ref_type }}: ${{ github.ref_name }} Commit SHA: ${{ github.sha }}