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

feat: Allow skipping setup #414

Merged
merged 2 commits into from
Oct 16, 2024
Merged

feat: Allow skipping setup #414

merged 2 commits into from
Oct 16, 2024

Conversation

rvesse
Copy link
Contributor

@rvesse rvesse commented Oct 15, 2024

If a user is invoking the action multiple times then the trivy binary gets installed multiple times. Users can avoid this by managing the installation themselves and setting the skip-setup input to true, or by letting the action install in on their first invocation and then setting skip-setup to true on subsequent invocations

This is an alternative solution to aquasecurity/setup-trivy#7 as discussed in that PR to address aquasecurity/setup-trivy#6

By allowing users to control whether the call to the setup-trivy action is made they can control how the trivy binary is installed, and avoid installing it multiple times if they have workflows that call trivy multiple times.

Added an example test at https://github.com/rvesse/setup-trivy-debugging/blob/main/.github/workflows/setup-trivy-indirect-fixed.yml with job output at https://github.com/rvesse/setup-trivy-debugging/actions/runs/11342576655/job/31543286568 where we can see that Trivy is no longer installed multiple times

@rvesse rvesse marked this pull request as ready for review October 15, 2024 08:52
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add examples to README.md using setup-trivy action + skip-setup-trivy input?

README.md Outdated Show resolved Hide resolved
@rvesse rvesse force-pushed the skip-setup branch 2 times, most recently from 323bf39 to b0d6293 Compare October 15, 2024 09:08
@rvesse
Copy link
Contributor Author

rvesse commented Oct 15, 2024

Can you add examples to README.md using setup-trivy action + skip-setup-trivy input?

Yes, added examples of both calling setup-trivy directly and relying on the implicit call to it

If a user is invoking the action multiple times then the trivy binary
gets installed multiple times.  Users can avoid this by managing the
installation themselves and setting the skip-setup input to true, or by
letting the action install in on their first invocation and then setting
skip-setup to true on subsequent invocations
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simar7 wdyt?

@simar7 simar7 self-requested a review October 16, 2024 01:56
Copy link
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@antoninbas
Copy link

Would love to use this. Could we have a v0.29.0 release for the action?

@DmitriyLewen
Copy link
Contributor

Hello @antoninbas
Unfortunately, we are busy with other tasks.

But you can use commit number or master branch.

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.

4 participants