Skip to content

Commit

Permalink
Improve workflow format
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy <[email protected]>
  • Loading branch information
TommyTran732 authored Sep 6, 2024
1 parent 11d5307 commit 982aa59
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: polarix-containers/nginx
TAG: latest

jobs:
build:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
category: grype

0 comments on commit 982aa59

Please sign in to comment.