fresh-angle-76971
11/13/2025, 1:56 PMmicroscopic-river-74022
11/13/2025, 1:56 PMmicroscopic-river-74022
11/13/2025, 1:56 PMversion.excludeFields configuration to exclude specific fields from version calculation. This is documented for various action types like [Build exec]() and [Run exec]().
For example:
yaml
version:
excludeFields:
- [spec, env, HOSTNAME]
By experimenting with excluding different fields, you might be able to determine what's contributing to version changes, though this is more of a manual investigation approach rather than an automated visualization tool.
The knowledge sources do not explicitly mention a command or feature that directly shows you all the inputs to an action's version calculation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/13/2025, 1:57 PMfresh-angle-76971
11/13/2025, 2:07 PMmicroscopic-river-74022
11/13/2025, 2:07 PMmicroscopic-river-74022
11/13/2025, 2:07 PMversion.excludeFields
You can exclude specific configuration fields from version calculation. As documented in the [Run container reference](), you specify paths to fields that should be ignored:
yaml
version:
excludeFields:
- [spec, env, HOSTNAME]
This works for fields that you know change frequently but shouldn't trigger version updates, such as dynamic hostnames or environment-specific values.
## 2. Use version.excludeValues
For dynamic values that appear throughout your configuration, you can use version.excludeValues. As shown in the [Run exec reference]():
yaml
version:
excludeValues:
- ${var.hostname}
This replaces every occurrence of that string value when calculating the version. You can use template expressions here.
## 3. Use version.excludeFiles
According to the [garden get config outputs](), you can exclude specific files from version calculation:
yaml
version:
excludeFiles:
- some/compiled/binary
This is useful for files that change frequently but shouldn't affect the version, like non-deterministic compiled binaries.
## Important Caveat
The documentation warns: "Note that it is very important not to specify overly broad exclusions here, as this may cause the version to change too rarely, which may cause build errors or tests to not run when they should."microscopic-river-74022
11/13/2025, 2:07 PMmicroscopic-river-74022
11/13/2025, 2:07 PMfresh-angle-76971
11/13/2025, 2:16 PMmicroscopic-river-74022
11/13/2025, 2:16 PMmicroscopic-river-74022
11/13/2025, 2:16 PMinclude field specifies "POSIX-style paths or globs that should be regarded as source files for this action, and thus will affect the computed version of the action."
You can also exclude files using the exclude field or .gardenignore files.
## 2. Configuration Fields
As explained in the [Config Resolution documentation](), built-in action config fields like include and dependencies are resolved during preprocessing. The documentation also mentions that configuration is involved in version calculation.
The [garden get config outputs]() shows that you can exclude specific config fields using version.excludeFields, which implies that by default, configuration fields contribute to the version.
## 3. Dependencies
The [Glossary]() explicitly states: "Each version also factors in the versions of every dependency. This means that anytime a version of something that is depended upon changes, every dependant's version also changes."
The [Team Caching documentation]() confirms this: "Garden calculates the version of each action, based on the source files and configuration involved, as well as any upstream dependencies."
## Summarymicroscopic-river-74022
11/13/2025, 2:17 PMmicroscopic-river-74022
11/13/2025, 2:17 PMfresh-angle-76971
11/13/2025, 2:19 PMkind: Run
name: say-hello
type: exec
spec:
command: ["echo", "Hello!"]microscopic-river-74022
11/13/2025, 2:19 PMmicroscopic-river-74022
11/13/2025, 2:19 PMyaml
kind: Run
name: say-hello
type: exec
spec:
command: ["echo", "Hello!"]
### 1. Source Files
According to the [Run exec reference](), when "no build reference is set, the command is run from the source directory of this action."
This means the source files in the action's directory will contribute to the version. By default, Garden includes files based on the include field (if specified) or uses default inclusion rules.
### 2. Configuration Fields
The configuration itself contributes to the version. In your case, this includes:
- The spec.command field with value ["echo", "Hello!"]
- Any other configuration fields present in the action
### 3. Dependencies
As stated in the [Glossary](): "Each version also factors in the versions of every dependency."
Your action doesn't explicitly list any dependencies, but if there are any implicit dependencies, they would also contribute to the version.
## What's NOT Contributing (in your case)
Since your action:
- Has no build reference
- Has no explicit dependencies listed
- Has no version.excludeFields, version.excludeFiles, or version.excludeDependencies configurations
The version calculation is relatively simple: source files in the action's directory + the action's configuration fields.
The knowledge sources don't provide more granular detail about which specific internal fields or metadata beyond these categories contribute to the version hash.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/13/2025, 2:19 PMfresh-angle-76971
11/13/2025, 2:37 PMmicroscopic-river-74022
11/13/2025, 2:37 PMmicroscopic-river-74022
11/13/2025, 2:37 PMversion.excludeFields or version.excludeValues as discussed in our previous conversation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
11/13/2025, 2:37 PM