From 982aa5988ef105604e3c2ef8464c38e66dca15b9 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 6 Sep 2024 12:04:10 -0700 Subject: [PATCH] Improve workflow format Signed-off-by: Tommy --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfd7e39..fd42f84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: polarix-containers/nginx + TAG: latest jobs: build: @@ -46,7 +47,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - latest + ${{ env.TAG }} - name: Build and push Docker image id: build-and-push @@ -68,7 +69,7 @@ jobs: - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} format: template template: '@/contrib/sarif.tpl' output: trivy-results.sarif @@ -93,11 +94,11 @@ jobs: uses: anchore/scan-action@v4 id: grype with: - image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} fail-build: false - name: Upload Grype scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@v3 with: sarif_file: ${{ steps.grype.outputs.sarif }} - category: grype \ No newline at end of file + category: grype