Cannot use template parameter in condition if parameter value coming from strategy matrix

Copper Contributor

I am having problem in calling template as the pre-condition is not getting satisfied, I am comparing parameter value to select which template to call at runtime, here I am having parameter value coming from strategy matrix and I think that might be the issue.

pipeline yaml :

stages:
- stage: build_stage
  jobs:
  - job:
    strategy:
      matrix:
        Dev_Build:
          build_type: "dev"
        Rel_Build:
          build_type: "rel"

    steps:
    - template: test_conditional_template.yml@templates_repo
      parameters:
        build: $(build_type)

test_conditional_template.yml :

parameters:
- name: build
  type: string
  default: 'dev'

steps:
- ${{ if eq(parameters.build, 'dev') }}:     # this condition is not working
 - template: test_conditional_template_generic.yml@templates_repo
   parameters:
    build_quality: ${{ parameters.build }}
0 Replies