Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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