-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(trivy.yml): remove matrix strategy for building Docker images t…
…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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|