send notification if action fails
Some checks failed
Container Build / build-image (push) Successful in 45s
Container Publish / build-image (push) Failing after 58s

This commit is contained in:
Paolo Asperti 2024-05-15 20:31:26 +02:00
parent f57440c5be
commit edb905a4aa
Signed by: paspo
GPG Key ID: 06D46905D19D5182
2 changed files with 20 additions and 0 deletions

View File

@ -56,3 +56,13 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: git.libreschool.org/bglug/hugo-extended:latest
- name: send mattermost notification
if: failure()
uses: mattermost/action-mattermost-notify@master
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
MATTERMOST_CHANNEL: the-best-channel
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

View File

@ -33,3 +33,13 @@ 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 }}
MATTERMOST_CHANNEL: the-best-channel
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