Skip to content

Commit

Permalink
chore: add short-lived caching of grype db
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Zantow <kzantow@gmail.com>
  • Loading branch information
kzantow committed Jul 29, 2024
1 parent 3dd8c8b commit a944310
Show file tree
Hide file tree
Showing 18 changed files with 74,629 additions and 6,475 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# force unix line endings for consistent ncc output
*.js text eol=lf
package.json text eol=lf
package-lock.json text eol=lf
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: node --version
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run audit
- run: npm run build
- run: git status --porcelain
- run: git diff
- run: git diff --ws-error-highlight=all | cat -v
- run: git diff --exit-code

test:
Expand Down Expand Up @@ -53,22 +57,22 @@ jobs:
path: ./

- name: "Donwload Grype v0.54.0"
id: grype
uses: ./download-grype # anchore/scan-action/download-grype
with:
grype-version: v0.54.0

- name: "Check Grype version before scan-action"
run: grype version | egrep "^Version:.*0.54.0$"
run: ${{ steps.grype.outputs.cmd }} version | egrep "^Version:.*0.54.0$"

- name: "Scan test image"
uses: ./
with:
image: "alpine:latest"
grype-version: v0.54.0 # set the same version to test that current Grype binary wasn't overwritten by the latest version
fail-build: false # to prevent fail due to vuln:s on test image

- name: "Check Grype version after scan-action"
run: grype version | egrep "^Version:.*0.54.0$"
run: ${{ steps.grype.outputs.cmd }} version | egrep "^Version:.*0.54.0$"

test-all:
strategy:
Expand Down
Loading

0 comments on commit a944310

Please sign in to comment.