Skip to content

Commit 37f748b

Browse files
authored
Simplify CI if/else var assignment (#10746)
1 parent 239f8fc commit 37f748b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

eng/ci/official-build.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,15 @@ variables:
4949
- template: /eng/ci/templates/variables/build.yml@self
5050
- template: /ci/variables/cfs.yml@eng
5151
- name: OfficialBranch
52-
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
53-
value: true
54-
${{ else }}:
55-
value: false
52+
value: ${{ or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}
53+
- name: SignFiles # variable for access in other templates
54+
value: ${{ or(eq(variables.OfficialBranch, true), eq(parameters.signFiles, true)) }}
5655
- name: '1ESTemplate'
5756
# force official to be true if an official branch. Otherwise respect the official parameter.
5857
${{ if or(eq(variables.OfficialBranch, true), eq(parameters.forceOfficial, true)) }}:
5958
value: 'v1/1ES.Official.PipelineTemplate.yml@1es'
6059
${{ else }}:
6160
value: 'v1/1ES.Unofficial.PipelineTemplate.yml@1es'
62-
- name: SignFiles # variable for access in other templates
63-
value: ${{ or(eq(variables.OfficialBranch, true), eq(parameters.signFiles, true)) }}
6461

6562
extends:
6663
template: ${{ variables['1ESTemplate'] }}

0 commit comments

Comments
 (0)