title: Azure YAML - Dynamically set stage/job execution order with variable
body: <p>I'm trying to create a yaml pipeline with three stages that can be executed in different orders depending on the Pull Request source branch. For example:</p>
  <p>If var = default then</p>
  <ol>
  <li>Stage A</li>
  <li>Stage B</li>
  <li>Stage C</li>
  </ol>
  <p>If var != default then</p>
  <ol>
  <li>Stage A</li>
  <li>Stage C</li>
  <li>Stage B</li>
  </ol>
  <p>Here's what I have so far:
  variables:</p>
  <pre><code>- name: abcDependsOn
    ${{ if not(contains(variables['System.PullRequest.SourceBranch'], 'hotfix' )) }}:
      value: 'Publish'
    ${{ if contains(variables['System.PullRequest.SourceBranch'], 'hotfix' ) }}:
      value: 'DeployXYZ'
  - name: xyzDependsOn
    ${{ if not(contains(variables['System.PullRequest.SourceBranch'], 'hotfix' )) }}:
      value: 'DeployABC'
    ${{ if contains(variables['System.PullRequest.SourceBranch'], 'hotfix' ) }}:
      value: 'Publish'
  
  stages: 
  - stage: Publish
    jobs:
    - job: publish
  
  - stage: DeployABC
    dependsOn: ${{ variables.abcDependsOn }}
    jobs:
    - job: deployabc
  
  - stage: DeployXYZ
    dependsOn: ${{ variables.xyzDependsOn }}
    jobs:
    - job: deployxyz
  </code></pre>
  <p>This isn't work because the dependsOn template expression variables are being evaluated before the runtime expression variables (I think). Is this even possible?</p>