Skip to content

Commit

Permalink
chore(trivy.yml): remove matrix strategy for building Docker images t…
Browse files Browse the repository at this point in the history
…o simplify the workflow

fix(trivy.yml): update image-ref and sarif_file values to remove matrix suffix for consistency and clarity
  • Loading branch information
jandroav committed Dec 1, 2023
1 parent af2cae3 commit 015957e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,25 @@ jobs:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: "ubuntu-20.04"
strategy:
matrix:
image: [
{dockerfile: Dockerfile, suffix: ''},
{dockerfile: Dockerfile.alpine, suffix: '-alpine'},
]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build an image from Dockerfile
run: |
docker build -t liquibase/liquibase${{ matrix.image.suffix }}:${{ github.sha }} -f ${{ matrix.image.dockerfile }} .
docker build -t liquibase/liquibase:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@b77b85c0254bba6789e787844f0585cde1e56320
with:
image-ref: 'liquibase/liquibase${{ matrix.image.suffix }}:${{ github.sha }}'
image-ref: 'liquibase/liquibase:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results${{ matrix.image.suffix }}.sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results${{ matrix.image.suffix }}.sarif'
sarif_file: 'trivy-results.sarif'

- name: Generate Security Report
uses: rsdmike/[email protected]
Expand Down

0 comments on commit 015957e

Please sign in to comment.