, I am trying to display project outputs after run...
# 🤖|ask-kapa
a
@microscopic-river-74022 , I am trying to display project outputs after running a Build action. The reference in project.garden.yaml is
Copy code
outputs:
  - name: app_image
    value: "${actions.build.app.outputs.deploymentImageName}"
I have a Build Action with the name
app
defined. I run
garden build --env ci
which completes successfully running the container build. I then run `` and receive the following error:
Copy code
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.
m
Please stand by @ancient-island-74119 as I search the knowledge base. I normally take about 15 seconds or so. :wave:
---------------------- It looks like you’re defining project outputs in project.garden.yaml and trying to reference an action output. That’s valid, but only in Garden versions that support resolving action outputs in project outputs. The docs show this pattern as correct: - Example of project outputs referencing a container Build output: outputs: my-action-image: ${actions.build.my-image.outputs.deployment-image-id} (This is shown as a supported use case for project outputs.) ([Project outputs]()) However, your error “Could not find key actions. Available keys: local, command, datetime, project, git, secrets, variables, var, environment, providers, modules, runtime.” indicates the template context at evaluation time doesn’t include actions., which means action outputs aren’t available in that context. The docs also note that provider and project configs cannot reference action outputs, while action configs can reference them ([Action outputs]()). There’s a discrepancy between these pages and support threads also confirm that providers are resolved ahead of actions and can’t use action outputs; project outputs can be retrieved via garden get outputs, but the availability of actions. depends on resolution order/version. ([Discord thread]())
What you can do: - If you’re on a version where project outputs can reference actions (as in the “Project outputs” doc), ensure you evaluate outputs after the build graph has been resolved and built. Use garden get outputs (after garden build) to retrieve them. ([Project outputs]()) - If your version doesn’t support actions.* in project outputs (as the error suggests), you’ll need a workaround, e.g.: - Use garden publish with --tag and derive the image reference externally (as noted in the support thread). ([Discord thread]()) - Or pass the image ID to a Deploy/Run/Test action and expose it another way (actions can reference each other’s outputs) ([Action outputs]()). I’m sorry for the ambiguity—the knowledge sources conflict on whether project outputs can reference actions.* universally. If you share your Garden version, I can align the guidance precisely. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
a
@microscopic-river-74022 my garden version: 0.14.7
m
Let me check the knowledge base for you again. One moment! :books:
---------------------- Thanks. In 0.14.x, project outputs can reference action outputs, but only when resolved in the project outputs context. The docs show this exact pattern as supported: - Project outputs referencing a container Build output: outputs: my-action-image: ${actions.build.my-image.outputs.deployment-image-id} (retrievable via garden get outputs) ([Project outputs](); [Bonsai 0.13 example]()). Your error “Could not find key actions … Available keys: …” means the template was evaluated in a context that doesn’t include actions.*. This usually happens if: - You try to resolve it in provider/project config contexts that don’t support action outputs, or - You’re using a command/path that evaluates outputs before the action graph is available. What to do on 0.14.7: - Define the output as you did, then fetch it with: garden get outputs This command resolves project outputs (including actions.* and runtime outputs) and will trigger required actions if needed ([Project outputs]()). - Ensure you’re not trying to use ${actions.*} in provider config or other contexts that disallow it ([Action outputs]()). If garden get outputs still throws the same “Could not find key actions” error, please share the exact command you ran and confirm the output is under Project.outputs in project.garden.yaml, not in provider config. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted