Skip to content

Commit

Permalink
[no ticket] re-order vuln scans (#3037)
Browse files Browse the repository at this point in the history
### Time to review: __1 mins__

## Changes proposed

Changes the grype vuln scan that outputs to stdout to run last

## Context for reviewers

Right now, Github Actions expands the last failing action within a PR:

<img width="704" alt="image"
src="https://github.com/user-attachments/assets/007f1af7-8dba-404e-a185-7135d43095e7">

The UX of this is poor, because second the anchor/grype scan action
doesn't output anything to stdout. With this change, the action that
outputs to stdout will run second, so you should get a better experience
when you click into the actions run for a failing PR.
  • Loading branch information
coilysiren authored Dec 2, 2024
1 parent 56d7573 commit a2ce07d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/vulnerability-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,25 @@ jobs:
docker load < /tmp/docker-image.tar
- name: Run Anchore vulnerability scan
if: always() # Runs even if there is a failure
uses: anchore/scan-action@v4
id: anchore-scan-json
with:
image: ${{ needs.build-and-cache.outputs.image }}
output-format: table
output-format: json
fail-build: true
severity-cutoff: medium

- name: Run Anchore vulnerability scan
if: always() # Runs even if there is a failure
uses: anchore/scan-action@v4
id: anchore-scan-json
with:
image: ${{ needs.build-and-cache.outputs.image }}
output-format: json
output-format: table
fail-build: true
severity-cutoff: medium

- name: Save output to workflow summary
- name: Print output to workflow summary
if: always() # Runs even if there is a failure
run: |
jq '.matches | map(.artifact | { name, version, location: .locations[0].path })' ${{ steps.anchore-scan-json.outputs.json }}
Expand Down

0 comments on commit a2ce07d

Please sign in to comment.