Can I have branch information as part of garden te...
# 🤖|ask-kapa
s
@microscopic-river-74022 Can I have branch information as part of garden templating similart to ${local.usernameLowerCase}
m
Please stand by @swift-island-27000 as I search the knowledge base. I normally take about 15 seconds or so. :wave:
---------------------- Yes, you can have branch information as part of Garden templating. The template string
${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:
Copy code
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: ----------------------
message has been deleted