scan-action icon indicating copy to clipboard operation
scan-action copied to clipboard

Update documentation how to continue on failure

Open kzantow opened this issue 4 years ago • 3 comments

This PR was opened for the use case of continuing on failure to check an exit code later. But there is already a way to do this with GitHub Actions, we should document this:

- uses: anchore/scan-action@v3
  id: scan
  continue-on-error: true
  ...
- run: exit 1
  if: ${{steps.scan.outcome == 'failure'}}

Example: https://github.com/kzantow-anchore/sbom-action-test/blob/scan-test/.github/workflows/scan-test.yml

kzantow avatar Oct 05 '21 16:10 kzantow

I just want to note that this doesn't solve the issue if this is wrapped in a composite action as currently it does not support continue-on-error

edwardyufinnai avatar Dec 03 '21 01:12 edwardyufinnai

Thanks for the context @edwardyufinnai. We'll take a look at if there is any way we can make this better going forward.

spiffcs avatar Dec 07 '21 20:12 spiffcs

I've used the following, to ensure the "Upload Anchore scan SARIF report" step will run regardless if the scan reports vulnerabilities or not.

if: ${{ success() || failure() }}

AErmie avatar Feb 20 '22 16:02 AErmie