Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
0
-
Description
Issue description
Conditional tasks do not allow for matching to result of a variable expansion. The match is done as plain text.
Example
- Create a build variable called TEST_BRANCH
- Add condition to plan:
Variable planRepository.branch equals ${bamboo.TEST_BRANCH} - Save
Suggestion
Allow variable expansion for task conditions
Workaround
You can effectively add these conditions by using a Script task instead of the conditional task:
Shell
# only run git commands on specific "test branch" if [[ ${bamboo.planRepository.branch} -eq ${bamboo.TEST_BRANCH} ]]; then # git commands else echo "Skipping, condition not met"; fi
Powershell
# only run git commands on specific "test branch" if ($bamboo_planRepository_branch -eq $bamboo_TEST_BRANCH) { # git commands } else { write-host "Skipping, condition not met" }