Skip to content

Commit

Permalink
fix(CI): Fixed image tag error in Trivy scan
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiSarkar12 committed Feb 20, 2024
1 parent 40fee11 commit 180bf1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,13 @@ jobs:
file: Docker/prod/${{ matrix.filename }}
platforms: linux/amd64,linux/arm64,linux/arm/v7

- name: Generate short commit SHA
run: echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Run Trivy security scan
uses: aquasecurity/trivy-action@0.17.0
with:
image-ref: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image_name }}:sha-$(git rev-parse --short ${{ github.sha }}) # Use the short commit SHA as the tag to find the image
image-ref: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.image_name }}:sha-${{ env.SHORT_SHA }}
format: ${{ github.event_name == 'pull_request' && 'table' || 'sarif' }}
exit-code: 1
vuln-type: os,library
Expand Down

0 comments on commit 180bf1b

Please sign in to comment.