Skip to content

Commit

Permalink
figuring out conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Nov 3, 2023
1 parent a6d4360 commit c2a9028
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
snyk:
name: Snyk Scan
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@master
Expand All @@ -28,10 +27,12 @@ jobs:
- name: Format Snyk Message
uses: sergeysova/jq-action@v2
continue-on-error: true
with:
cmd: jq -r '.vulnerabilities[] | "* **\(.severity)** - [\(.identifiers.CVE[0])] \(.title) in `\(.moduleName)` v\(.version). Fixed in \(.fixedIn)"' snyk.json >> snyk.txt

- name: Determine whether to comment
continue-on-error: true
run: |
if [[ $(wc -l < snyk.txt) -gt 1 ]]; then exit 0; fi
exit 1
Expand All @@ -45,7 +46,6 @@ jobs:
trivy:
name: Trivy Scan
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -70,10 +70,12 @@ jobs:
- name: Format Trivy Message
uses: sergeysova/jq-action@v2
continue-on-error: true
with:
cmd: jq -r '.Results[] | .Vulnerabilities[] | "* **\(.Severity)** [\(.Title)](\(.PrimaryURL)) in `\(.PkgName)` v\(.InstalledVersion). Fixed in v\(.FixedVersion)"' trivy.json >> trivy.txt

- name: Determine whether to comment
continue-on-error: true
run: |
if [[ $(wc -l < trivy.txt) -gt 1 ]]; then exit 0; fi
exit 1
Expand Down

0 comments on commit c2a9028

Please sign in to comment.