ancient-island-74119
09/03/2025, 4:06 AMoutputs:
- name: app_image
value: "${actions.build.app.outputs.deploymentImageName}"
Running garden get outputs the Build actions are triggered but I receive the following error:
...(removed for char limits)
ℹ build.app → Getting status for Build app (type container) at version v-e5b0c8e672...
ℹ build.app2 → Getting status for Build app2 (type container) at version v-b0365ed458...
ℹ build.app → Building app (type container) at version v-e5b0c8e672...
ℹ build.app2 → Building app2 (type container) at version v-b0365ed458...
ℹ build.app → Building app:v-ef287852fe...
ℹ build.app2 → Building app2:v-c41698070a...
✔ build.app2 → Done (took 1.1 sec)
✔ build.app → Done (took 1.2 sec)
project.garden.yaml:58
...
57 | - name: app_image
58 | value: "${actions.build.app.outputs.deploymentImageName}"
-----------------^
Could not find key actions. Available keys: local, command, datetime, project, git, secrets, variables, var, environment, providers, modules, runtime.
See .garden/error.log for detailed error message
My garden project api version is set to apiVersion: garden.io/v2 and my garden version is garden version: 0.14.7.
Why aren't actions outputs available? Very strange that modules is available since it is a not supported in 0.14 afaik.
Anyway, any help would be appreciated! Thanks!ancient-island-74119
09/09/2025, 3:06 PMbrief-restaurant-63679
09/11/2025, 9:40 AMkind: Project which doesn't work. You can only reference action outputs in other actons.
Here's a quick example that I just tested and works as expected:
yaml
# In project.garden.yml
apiVersion: garden.io/v2
kind: Project
name: outputs-test
environments:
- name: local
---
# There's a Dockerfile in the same dir as the project.garden.yml file that the build uses
# The contents of the file are:
# FROM alpine:latest
# CMD ["echo", "Hello from my-build"]
kind: Build
type: container
name: my-build
---
kind: Run
type: exec
name: output-printer
spec:
command: [echo, "Image name is: ${actions.build.my-build.outputs.deploymentImageName}"]
When I run garden run output-printer I get: Image name is: my-buildbrief-restaurant-63679
09/11/2025, 9:41 AMFROM alpine:latest
CMD ["echo", "Hello from my-build"]brief-restaurant-63679
09/11/2025, 9:41 AMancient-island-74119
09/11/2025, 7:25 PMgarden get outputs --env ci --output json which would run a build - then taking those outputs be able to scan the image before pushing it. BUT maybe some combination of Run and Build (or other garden Action) would do it? idk
If there are any examples of this sort of use case available that would be great - I didnt notice any in the /examples available in the public repo.
Thanks again!brief-restaurant-63679
09/23/2025, 9:31 AMyaml
kind: Build
name: my-image
type: container
---
kind: Run
name: scan-image
type: exec
spec:
command: [/bin/sh, "-c", "snyk container test ${actions.build.my-image.outputs.deploymentImageId}"]
Note that we're using the deployImageId output here which contains the full image path with the version tag.brief-restaurant-63679
09/23/2025, 10:07 AMyaml
kind: ConfigTemplate
name: build-and-scan
configs:
- kind: Build
type: container
name: ${parent.name} # <--- Parent refers to the RenderTemplate.
description: ${parent.name} build # <--- So this becomes "my-image-one build" or "my-image-two build" (as per the RenderTemplate actions below)
- kind: Run
type: exec
name: scan-${parent.name}
description: Scan the ${parent.name} container image
dependencies:
- build.${parent.name}
spec:
command: ["/bin/sh", "-c", "snyk container test ${actions.build[parent.name].outputs.deploymentImageId}"]
---
kind: RenderTemplate
template: build-and-scan
name: my-image-one
---
kind: RenderTemplate
template: build-and-scan
name: my-image-two
With this you can e.g. run garden run scan-my-image-onebrief-restaurant-63679
09/23/2025, 10:10 AMyaml
kind: ConfigTemplate
name: build-image
inputs:
os:
type: string
arch:
type: string
configs:
- kind: Build
type: exec
# Note: ${parent.name} resolves to the name of the RenderTemplate config below
name: ${parent.name}-${inputs.os}-${inputs.arch}
spec:
command: ["./build.sh", "${inputs.os}", "${inputs.arch}"]
---
kind: RenderTemplate
name: build-image
template: build-image
matrix:
os: ["linux", "macos"]
arch: ["amd64", "arm64"]ancient-island-74119
09/29/2025, 8:18 PMancient-island-74119
11/07/2025, 6:17 PM