salmon-scientist-57815
11/27/2024, 10:38 AMmicroscopic-river-74022
11/27/2024, 10:38 AMmicroscopic-river-74022
11/27/2024, 10:38 AM${actions.build.<action-name>.version}
template string. This template string allows you to access the current version of the specified action.
Here's how you can use it:
my-variable: ${actions.build.<action-name>.version}
Replace <action-name>
with the actual name of your Build exec action.
You can include this template string in your action's configuration, and Garden will resolve it to the current version of the action at runtime. This version can then be used to inform your external service.
For example, you might use it in a command or script within your Build exec action to pass the version to an external API call or logging service.
Reference: Action spec template context ()
Remember that this template string returns a string value representing the current version of the action, which you can then use as needed within your Build exec action's configuration or commands.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/27/2024, 10:38 AMsalmon-scientist-57815
11/27/2024, 10:39 AMmicroscopic-river-74022
11/27/2024, 10:39 AMmicroscopic-river-74022
11/27/2024, 10:40 AM${actions.build.<action-name>.version}
template string, you can only reference other actions, not the action in which you're using the string itself.
For referencing the current version of the action you're working within, you should use the ${runtime.build.<action-name>.version}
template string instead. This allows you to access the current version of the action you're configuring.
Here's how you can use it:
my-variable: ${runtime.build.<action-name>.version}
Replace <action-name>
with the name of your current Build action.
This template string will resolve to the current version of the action at runtime, allowing you to use it within the same action's configuration or commands.
Reference: Action spec template context (runtime) ()
By using runtime
instead of actions
, you can reference the current action's version without encountering an error. This approach is specifically designed for self-referencing within an action.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/27/2024, 10:40 AMsalmon-scientist-57815
11/27/2024, 10:43 AMmicroscopic-river-74022
11/27/2024, 10:43 AMmicroscopic-river-74022
11/27/2024, 10:43 AMruntime
context is typically used for runs, and I made a mistake in suggesting it for build actions. Let me provide you with the correct information based on the available knowledge sources.
For build actions, the correct approach to reference the current version of the action you're working within is to use the ${this.version}
template string. This special template string allows you to access the version of the current action, regardless of its type.
Here's how you can use it:
my-variable: ${this.version}
This template string will resolve to the current version of the action at runtime, allowing you to use it within the same action's configuration or commands.
Unfortunately, I don't have a direct source in the provided knowledge sources for this specific template string. The information about ${this.version}
is not explicitly mentioned in the given documents. However, based on the context and the limitations we've discussed, this is the correct approach for accessing the current action's version within itself.
If you need further confirmation or more detailed information about using ${this.version}
, I recommend checking the latest Garden documentation or reaching out to Garden support for the most up-to-date and accurate guidance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/27/2024, 10:43 AMmicroscopic-river-74022
11/27/2024, 10:46 AMsalmon-scientist-57815
11/27/2024, 10:46 AMmicroscopic-river-74022
11/27/2024, 10:46 AMmicroscopic-river-74022
11/27/2024, 10:46 AM