Skip to content

Env variables can't use in material git branch. #12594

Closed Answered by chadlwilson
zszen asked this question in Q&A
Discussion options

You must be logged in to vote

No, and this is by design. Materials in GoCD are independent of pipelines, and environment variables are a process-runner/OS-level construct that are only known at run time. Not all materials in GoCD assume use of a separate OS-level process call, so dynamic environment variables don't make sense there either.

In practice you can use environment variables only in tasks; when they are run on agents.

You might be able to use pipeline parameters instead if you are using pipeline templates (with multiple pipelines for different branches), but whether that makes sense depends on what you are trying to achieve.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zszen
Comment options

Answer selected by zszen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants