diff --git a/.gitea/workflows/build_and_push.yaml b/.gitea/workflows/build_and_push.yaml index 36c7322..02f45b2 100644 --- a/.gitea/workflows/build_and_push.yaml +++ b/.gitea/workflows/build_and_push.yaml @@ -28,26 +28,6 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - - name: Build and publish - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - # load: true # load doesn't work with multiple platforms - tags: git.libreschool.org/bglug/hugo-extended:latest - - - name: Run Trivy vulnerability scanner - id: scan - uses: aquasecurity/trivy-action@master - with: - image-ref: "git.libreschool.org/bglug/hugo-extended:latest" - format: "json" - output: "trivy-results.json" - - - name: check output - run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi - - name: Build and publish uses: docker/build-push-action@v5 with: @@ -56,3 +36,11 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: git.libreschool.org/bglug/hugo-extended: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/bglug/hugo-extended: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 f7e6d65..1e84c0f 100644 --- a/.gitea/workflows/vulnscan.yaml +++ b/.gitea/workflows/vulnscan.yaml @@ -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