-
Notifications
You must be signed in to change notification settings - Fork 3
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
Avoid repeatedly setting up Trivy if called multiple times with same args in same workflow #6
Comments
rvesse
added a commit
to rvesse/setup-trivy
that referenced
this issue
Oct 14, 2024
This commit adds tracking and detection of when the current job has already called setup-trivy (whether directly/indirectly) and avoids repeatedly installing it once it has been installed
rvesse
added a commit
to rvesse/setup-trivy
that referenced
this issue
Oct 14, 2024
This commit adds tracking and detection of when the current job has already called setup-trivy (whether directly/indirectly) and avoids repeatedly installing it once it has been installed
Proposed fix at #7 |
rvesse
added a commit
to rvesse/setup-trivy
that referenced
this issue
Oct 15, 2024
This commit adds tracking and detection of when the current job has already called setup-trivy (whether directly/indirectly) and avoids repeatedly installing it once it has been installed
rvesse
added a commit
to rvesse/setup-trivy
that referenced
this issue
Oct 15, 2024
This commit adds tracking and detection of when the current job has already called setup-trivy (whether directly/indirectly) and avoids repeatedly installing it once it has been installed
Resolved by alternative means in aquasecurity/trivy-action#414 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have a number of workflows with steps like the following:
trivy-action
and we may remove this in the future)exit-code: 0
to get a full report of all vulnerabilitiesexit-code: 1
andseverity: HIGH,CRITICAL
to fail our build if any High/Critical vulnerabilities are presentHere's an example of this - https://github.com/telicent-oss/shared-workflows/blob/main/.github/workflows/maven.yml#L230-L268
Since
trivy-action
refactored itself to be a composite action it now uses thissetup-trivy
action to ensuretrivy
is installed and available. However it doesn't include any logic to avoid repeated work so this now results in our workflows downloading and installing Trivy 3 times e.g.This is from https://github.com/telicent-oss/jwt-servlet-auth/actions/runs/11323718298/job/31487698417 if you want to see the GitHub Actions output directly, copied and pasted relevant sections above as Actions workflow logs expire after a time. Note that run was still using
v0.1.0
of thesetup-trivy
action but the same issue can be seen even if explicitly usingv0.2.0
, I've put together a small test repository with various example workflows at https://github.com/rvesse/setup-trivy-debuggingWith the previous docker based trivy action this wasn't an issue as GitHub Actions would build the image once and then use it each time we involved the
trivy-action
(Aside - Yes you have the option of caching the binary install in which case steps would be skipped BUT caching doesn't work with
latest
version and for my company we always want to be using the latest version)One possibility might be to set an environment variable at the conclusion of the composite action and use that to make subsequent invocations conditional, but there could be other ways, I'll throw together a quick PR for you guys to look at but feel free to solve this other ways as well.
The text was updated successfully, but these errors were encountered: