From d2521334cd5bcd30763c03b1015c9bcb094bee17 Mon Sep 17 00:00:00 2001 From: Rupeekshan Maheswaran <63111541+Rupeekshan@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:47:27 +0530 Subject: [PATCH] ci: Update slack notification payload format for new upgrade (#461) --- .github/workflows/component-scan.yml | 46 ++++++++++------------------ 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/component-scan.yml b/.github/workflows/component-scan.yml index 08ee1e59..b3793dd1 100644 --- a/.github/workflows/component-scan.yml +++ b/.github/workflows/component-scan.yml @@ -218,33 +218,21 @@ jobs: if: ${{ startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/') }} uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.H2O_OPS_SLACK_BOT_TOKEN }} payload: | - { - "text": "Trivy Vulnerability Report", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Java MOJO Runtime* \n_Vulnerabilities have been detected on the `${{ github.ref_name }}` branch_" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "> *Trivy :: `${{ env.TRIVY_SUMMARY }}`*\n> *Prisma :: `${{ env.PRISMA_SUMMARY }}`*" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "${{ env.CODE_OWNERS }}, please review the following reports: , " - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.H2O_OPS_SLACK_BOT_TOKEN }} + channel: ${{ secrets.SLACK_CHANNEL_ID }} + text: "Trivy Vulnerability Report" + blocks: + - type: "section" + text: + type: "mrkdwn" + text: "*Java MOJO Runtime* \n_Vulnerabilities have been detected on the `${{ github.ref_name }}` branch_" + - type: "section" + text: + type: "mrkdwn" + text: "> *Trivy :: `${{ env.TRIVY_SUMMARY }}`*\n> *Prisma :: `${{ env.PRISMA_SUMMARY }}`*" + - type: "section" + text: + type: "mrkdwn" + text: "${{ env.CODE_OWNERS }}, please review the following reports: , "