diff --git a/.github/workflows/slack-webhook.yaml b/.github/workflows/slack-webhook.yaml index f85128a..7e79fd8 100644 --- a/.github/workflows/slack-webhook.yaml +++ b/.github/workflows/slack-webhook.yaml @@ -1,28 +1,12 @@ - name: Post a message in a channel - -on: - workflow_call: - inputs: - workflow-event: - required: true - type: string - secrets: - slackWebhookUrl: - required: true - -jobs: - notify: - name: PR notification - runs-on: [ubuntu-latest] - steps: - - name: Post message - uses: slackapi/slack-github-action@v1.25.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - with: - payload: | - { - "title": ${{ toJson(fromJson(inputs.workflow-event).title) }}, - "author": ${{ toJson(fromJson(inputs.workflow-event).user.login) }}, - "link": ${{ toJson(fromJson(inputs.workflow-event).html_url) }} - } + uses: slackapi/slack-github-action@v2.0.0 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "*GitHub Action build result*: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"