0

I've got a variable in my library with a value of 'yes': screenshot of library variable

I store this variable in a variables object like so:

variables:
  - name: runNonDeltaTest
    value: $(RUN_NON_DELTA_TEST)

When running the following script in the pipeline it prints out the value of this variable as expected(all in the same file):

- script: |
    echo "Value of runNonDeltaTest is ${{variables.runNonDeltaTest}}"
  displayName: Logging runNonDeltaTest variable

But when I use it in a condition (or in an if statement), it doesnt work and always returns that the statement is false:

jobs:
  - deployment: Deploy
    displayName: Deploy dev stage
    condition: eq(variables.runNonDeltaTest, 'yes')
    strategy:
      runOnce:
        deploy:
          steps:
            - script: |
                echo "We have been called"
              displayName: Logging variable

The output of this is:
Output of the above command

I've tried both using variables.runNonDeltaTest and variables['runNonDeltaTest'] but the condition always fails, even though when logging it it shows the correct value

0 Answers0