From 6209e350bf2eb4131b1a3272ea83ea36af4c56be Mon Sep 17 00:00:00 2001 From: paspo Date: Wed, 15 May 2024 23:03:29 +0200 Subject: [PATCH] mattermost notification --- .gitea/workflows/build_and_push.yaml | 8 ++++++++ .gitea/workflows/vulnscan.yaml | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build_and_push.yaml b/.gitea/workflows/build_and_push.yaml index 245477c..c2a44c8 100644 --- a/.gitea/workflows/build_and_push.yaml +++ b/.gitea/workflows/build_and_push.yaml @@ -63,3 +63,11 @@ jobs: # linux/arm64 push: true tags: git.libreschool.org/libreschool/libreschool.org:latest + + - name: send mattermost notification + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} + TEXT: | + :white_check_mark: `${{ github.repository }}` A new container image has been pushed to `git.libreschool.org/libreschool/libreschool.org:latest` + MATTERMOST_ICON: https://cdn3.iconfinder.com/data/icons/system-basic-vol-4-1/20/icon-note-attention-alt3-512.png diff --git a/.gitea/workflows/vulnscan.yaml b/.gitea/workflows/vulnscan.yaml index fc62afd..a9db78c 100644 --- a/.gitea/workflows/vulnscan.yaml +++ b/.gitea/workflows/vulnscan.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest container: image: catthehacker/ubuntu:act-latest - + steps: - name: Login to registry uses: docker/login-action@v3 @@ -33,3 +33,12 @@ jobs: # if some vulnerability is found, we fail - name: check output run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi + + - name: send mattermost notification + if: failure() + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }} + TEXT: | + Found **${{ steps.vulncount.outputs.VULNCOUNT }}** vulnerabilities in `${{ github.repository }}` + MATTERMOST_ICON: https://cdn3.iconfinder.com/data/icons/system-basic-vol-4-1/20/icon-note-attention-alt3-512.png