swift-island-27000
10/16/2024, 2:31 PMmicroscopic-river-74022
10/16/2024, 2:31 PMmicroscopic-river-74022
10/16/2024, 2:31 PM${git.branch}
is used to get the current Git branch. It resolves to an empty string if HEAD is in a detached state (e.g. when rebasing), or if the repository has no commits. The branch is resolved at the start of the Garden command's execution, and is not updated if the current branch changes during the command's execution.
Here is an example of how you can use it:
yaml
my-variable: ${git.branch}
This is similar to how you would use ${local.usernameLowerCase}
to get the current username in lowercase.
Please note that when using remote sources, the branch used is that of the project/top-level repository (the one that contains the project configuration).
You can find more information in the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/16/2024, 2:31 PM