Skip to content

Commit

Permalink
Fix Trivy caching in CI
Browse files Browse the repository at this point in the history
Update Trivy SBOM generation to invalidate the Trivy cache when
package-lock.json or composer.lock are modified.
  • Loading branch information
sbreker committed Apr 16, 2024
1 parent 4984252 commit 11ee01f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
uses: actions/cache@v4
with:
path: .trivycache/
key: ${{ runner.os }}-trivy-${{ hashFiles('**/lockfiles') }}
key: ${{ runner.os }}-trivy-${{ hashFiles('package-lock.json', 'composer.lock') }}
restore-keys: |
${{ runner.os }}-trivy-
- name: Generate SBOM
run: trivy fs --format cyclonedx --include-dev-deps --output sbom.xml .
run: trivy fs --cache-dir .trivycache --format cyclonedx --include-dev-deps --output sbom.xml .
env:
TRIVY_NO_PROGRESS: "true"

Expand Down

0 comments on commit 11ee01f

Please sign in to comment.