From d3a39545337038a0181dd7469d919ebdfbc102b8 Mon Sep 17 00:00:00 2001 From: Thomas Ubensee <34603111+tomuben@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:34:55 -0300 Subject: [PATCH] Added Report failure Status to Slack channel --- .github/workflows/update_trivy_cache.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/update_trivy_cache.yaml b/.github/workflows/update_trivy_cache.yaml index f6f1252e..8bb1d50e 100644 --- a/.github/workflows/update_trivy_cache.yaml +++ b/.github/workflows/update_trivy_cache.yaml @@ -21,6 +21,7 @@ jobs: DEBIAN_FRONTEND: noninteractive - name: Fetch trivy databases run: | + cat /tmp/not_there trivy image --download-java-db-only trivy image --download-db-only @@ -31,3 +32,17 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_SECRET }} AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} TRIVY_CACHE_LOCATION: ${{ secrets.TRIVY_CACHE_LOCATION }} + + - name: Report failure Status to Slack channel + id: report-failure-status-slack + # Also run this step in case of failures + if: ${{ always() }} + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + token: ${{ github.token }} + notification_title: "Release build in {repo} has {status_message}" + message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" + notify_when: "failure,cancelled,warnings,skipped" + env: + SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }} \ No newline at end of file