From 7bf1e0695580f1f562db5c70614479ede4a36845 Mon Sep 17 00:00:00 2001 From: Simon Ungar Felding <45149055+simonfelding@users.noreply.github.com> Date: Thu, 24 Apr 2025 22:43:38 +0200 Subject: [PATCH] maybe this works --- .github/workflows/build.yaml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8c7ab05..af89585 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -35,8 +35,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.DOCKERHUB_REPO }} - ${{ env.GHCR_REPO }} + ${{ env.DOCKER_REPO_DEV }} - name: Login to GHCR uses: docker/login-action@v3 @@ -55,7 +54,7 @@ jobs: uses: docker/build-push-action@v6 with: labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=false,name-canonical=true,push=true + outputs: type=image,"name=${{ env.DOCKER_REPO_DEV }}",push-by-digest=false,name-canonical=true,push=true context: ./build file: ./build/Dockerfile tags: "${{ env.DOCKER_REPO_DEV }}:${{ github.ref_name }}" @@ -148,19 +147,6 @@ jobs: digest="${{ steps.build.outputs.digest }}" touch "${{ runner.temp }}/digests/${digest#sha256:}" - - name: Run Trivy vulnerability scan - uses: aquasecurity/trivy-action@0.30.0 - with: - image-ref: "${{ env.DOCKERHUB_REPO }}:${{ env.version }}-build" - format: 'sarif' - exit-code: 0 - severity: 'CRITICAL,HIGH' - output: 'trivy-results.sarif' - - name: Upload Trivy scan SARIF report - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: 'trivy-results.sarif' - - name: Upload digest uses: actions/upload-artifact@v4 with: @@ -219,6 +205,19 @@ jobs: docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) + - name: Run Trivy vulnerability scan + uses: aquasecurity/trivy-action@0.30.0 + with: + image-ref: "${{ env.DOCKERHUB_REPO }}:${{ env.version }}-build" + format: 'sarif' + exit-code: 0 + severity: 'CRITICAL,HIGH' + output: 'trivy-results.sarif' + - name: Upload Trivy scan SARIF report + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: 'trivy-results.sarif' + - name: Inspect image run: | docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}