ancient-island-74119
08/29/2025, 10:29 PMgarden publish
? Preferably scan before the push occurs.microscopic-river-74022
08/29/2025, 10:29 PMmicroscopic-river-74022
08/29/2025, 10:30 PMgarden publish
. This allows you to integrate any custom logic or tool into your pipeline, ensuring that images are scanned before they are pushed to a registry.
Here’s the general approach:
1. Define a Run action in your Garden configuration that runs Trivy against the built image.
2. Sequence your actions so that the Run action (Trivy scan) runs after the build and before the publish step.
3. Only proceed to garden publish
if the scan passes.
Garden’s Stack Graph and Run actions are designed to support this kind of extensibility:
> Garden's Run actions (one of the four main action kinds, the others being Builds, Deploys and Tests) can also be used to wrap any script or tool that you'd like to call in your pipeline, so you always have a general-purpose escape hatch for any custom logic you need to run in your pipeline that doesn't fit easily into Garden's way of doing things.
[Custom deployment scripts]()
Note: The knowledge sources do not provide a specific example for Trivy or for running a scan as a pre-publish hook, but the described approach using Run actions is the recommended way to integrate such tools with Garden.microscopic-river-74022
08/29/2025, 10:30 PMgarden publish
if the scan succeeds. There is currently no documented way to have Garden automatically run a scan as part of the garden publish
command itself.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
08/29/2025, 10:30 PM