From 5987f463533aca5afc3625cff16090207a71b742 Mon Sep 17 00:00:00 2001 From: Will Murphy Date: Fri, 16 Jan 2026 06:26:40 -0500 Subject: [PATCH] Chore new slack action (#4553) * chore: new slack action Signed-off-by: Will Murphy * TEMP: exit 1 to test slack notify Signed-off-by: Will Murphy * new slack integration everywhere Signed-off-by: Will Murphy --------- Signed-off-by: Will Murphy --- .github/workflows/release.yaml | 22 ++++++++++++++----- .../workflows/update-cpe-dictionary-index.yml | 22 ++++++++++++++----- .../workflows/update-spdx-license-list.yaml | 22 ++++++++++++++----- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 75f3f67a4..4513d7f4e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -192,14 +192,24 @@ jobs: file: go.mod artifact-name: sbom.spdx.json - - uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e #v3.19.0 + - name: Notify Slack of new release + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a #v2.1.1 continue-on-error: true with: - status: ${{ job.status }} - fields: repo,workflow,action,eventName - text: "A new Syft release has been published: https://github.com/anchore/syft/releases/tag/${{ github.event.inputs.version }}" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "A new Syft release has been published: https://github.com/anchore/syft/releases/tag/${{ github.event.inputs.version }}" + blocks: + - type: section + text: + type: mrkdwn + text: | + *A new Syft release has been published* :rocket: + • Release: + • Repo: `${{ github.repository }}` + • Workflow: `${{ github.workflow }}` + • Event: `${{ github.event_name }}` if: ${{ success() }} release-install-script: diff --git a/.github/workflows/update-cpe-dictionary-index.yml b/.github/workflows/update-cpe-dictionary-index.yml index 9dcd60fc6..57034ec00 100644 --- a/.github/workflows/update-cpe-dictionary-index.yml +++ b/.github/workflows/update-cpe-dictionary-index.yml @@ -64,11 +64,21 @@ jobs: Update CPE dictionary index based on the latest available CPE dictionary token: ${{ steps.generate-token.outputs.token }} - - uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e #v3.19.0 + - name: Notify Slack on failure + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a #v2.1.1 with: - status: ${{ job.status }} - fields: workflow,eventName,job - text: Syft CPE dictionary index update failed - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "Syft CPE dictionary index update failed" + blocks: + - type: section + text: + type: mrkdwn + text: | + *Syft CPE dictionary index update failed* + • Workflow: `${{ github.workflow }}` + • Event: `${{ github.event_name }}` + • Job Status: `${{ job.status }}` + • <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run> if: ${{ failure() && env.SLACK_NOTIFICATIONS == 'true' }} diff --git a/.github/workflows/update-spdx-license-list.yaml b/.github/workflows/update-spdx-license-list.yaml index bdade44d9..dca4bd82a 100644 --- a/.github/workflows/update-spdx-license-list.yaml +++ b/.github/workflows/update-spdx-license-list.yaml @@ -44,11 +44,21 @@ jobs: Update SPDX license list based on the latest available list from spdx.org token: ${{ steps.generate-token.outputs.token }} - - uses: 8398a7/action-slack@77eaa4f1c608a7d68b38af4e3f739dcd8cba273e #v3.19.0 + - name: Notify Slack on failure + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a #v2.1.1 with: - status: ${{ job.status }} - fields: workflow,eventName,job - text: Syft SPDX license list update failed - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: "Syft SPDX license list update failed" + blocks: + - type: section + text: + type: mrkdwn + text: | + *Syft SPDX license list update failed* + • Workflow: `${{ github.workflow }}` + • Event: `${{ github.event_name }}` + • Job Status: `${{ job.status }}` + • <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run> if: ${{ failure() && env.SLACK_NOTIFICATIONS == 'true' }}