fix workflows

This commit is contained in:
Paolo Asperti 2024-06-03 22:03:26 +02:00
parent 6368189f07
commit a04ac75f85
Signed by untrusted user: paspo
GPG Key ID: 06D46905D19D5182
3 changed files with 12 additions and 15 deletions

View File

@ -24,11 +24,9 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
# linux/arm64
platforms: linux/amd64
push: false

View File

@ -32,13 +32,11 @@ jobs:
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and publish
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
# linux/arm64
platforms: linux/amd64
load: true
tags: git.libreschool.org/bglug/bglug.it:latest
@ -54,13 +52,11 @@ jobs:
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@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
# linux/arm64
platforms: linux/amd64
push: true
tags: git.libreschool.org/bglug/bglug.it:latest

View File

@ -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
@ -32,7 +32,10 @@ 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
id: vulncount
run: |
echo "VULNCOUNT=$(jq '.Results[0].Vulnerabilities|length' trivy-results.json)" >> ${GITHUB_OUTPUT}
if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
- name: send mattermost notification
if: failure()
@ -40,5 +43,5 @@ jobs:
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
TEXT: |
Found **${{ steps.vulncount.outputs.VULNCOUNT }}** vulnerabilities in `${{ github.repository }}`
:bug: 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