Skip to content

fix: add an output containing a pass/fail result#419

Open
erzz wants to merge 1 commit intoaquasecurity:masterfrom
erzz:outputs
Open

fix: add an output containing a pass/fail result#419
erzz wants to merge 1 commit intoaquasecurity:masterfrom
erzz:outputs

Conversation

@erzz
Copy link

@erzz erzz commented Oct 18, 2024

Closes #412

This adds a little basic logic to provide an output that gives the real result of the scan (findings or not) in a simple pass/fail format.

It still honours the exit code requested via the exit-code input in terms of pass/fail of the trivy command whilst providing the ability to take conditional actions later in a workflow (upload sarif, prepare reports in other formats using convert, uploading to another system etc)

Example from a workflow in a private repo using this branch:

image

Debug step in my workflow

- name: Check Output
        env:
          RESULT: ${{ steps.scan.outputs.result }}
        run: |
          echo "Trivy scan result output: $RESULT"

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an output that can be used in later steps to avoid duplicate runs

1 participant