Skip to content

Commit fc290e4

Browse files
workaround for issue in yml (#4559)
* workaround * update display name
1 parent 24262f6 commit fc290e4

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

jobs/prerelease.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,28 @@ extends:
4141
name: VSEngSS-MicroBuild2022-1ES
4242
customBuildTags:
4343
- ES365AIMigrationTooling
44+
4445
stages:
4546
- stage: verify_parameters
4647
jobs:
4748
- job: verify
49+
displayName: Verify parameters
4850
steps:
4951
- checkout: none
50-
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
51-
- ${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
52-
- 'This pipeline can only be run on main branch.'
52+
# breaking issue: variables['Build.SourceBranch'] is evaluating to ''.
53+
# TODO: Figure out why
54+
#- ${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
55+
# - 'This pipeline can only be run on main branch.'
56+
57+
# Workaround for the previous check not working
58+
- powershell: |
59+
Write-Host "##vso[task.logissue type=error]This pipeline can only be run from the main branch. Actual: $(Build.SourceBranch)"
60+
exit 1
61+
displayName: 'Enforce main branch'
62+
condition: ne(variables['Build.SourceBranch'], 'refs/heads/main')
5363
5464
- stage: stage
65+
dependsOn: verify_parameters
5566
jobs:
5667
- job: Job_1
5768
displayName: Build pre-release

jobs/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,23 @@ extends:
6565
- stage: verify_parameters
6666
jobs:
6767
- job: verify
68+
displayName: Verify parameters
6869
steps:
6970
- checkout: none
70-
# Introduce pipeline compilation errors to block scheduling if the requisite parameters are not set
71-
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}
72-
-'This pipeline can only be run on a release branch.'
71+
# breaking issue: variables['Build.SourceBranch'] is evaluating to ''.
72+
# TODO: Figure out why
73+
#- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release')) }}:
74+
# - 'This pipeline can only be run on release branch.'
75+
76+
# Workaround for the previous check not working
77+
- powershell: |
78+
Write-Host "##vso[task.logissue type=error]This pipeline can only be run from the release branch. Actual: $(Build.SourceBranch)"
79+
exit 1
80+
displayName: 'Enforce release branch'
81+
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release'))
7382
7483
- stage: stage
84+
dependsOn: verify_parameters
7585
jobs:
7686
- job: Job_1
7787
displayName: Build release

0 commit comments

Comments
 (0)