Skip to content

Commit 1b13436

Browse files
authored
devops: check branch bash (#1174)
1 parent 65624d6 commit 1b13436

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.azure-pipelines/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ pool:
66

77
steps:
88
- bash: |
9-
echo "Can only publish from a release branch. Unexpected branch name: $CURRENT_BRANCH"
10-
exit 1
9+
if [[ ! "$CURRENT_BRANCH" =~ ^release-.* ]]; then
10+
echo "Can only publish from a release branch."
11+
echo "Unexpected branch name: $CURRENT_BRANCH"
12+
exit 1
13+
fi
1114
env:
1215
CURRENT_BRANCH: ${{ variables['Build.SourceBranchName'] }}
13-
condition: ${{ not(startsWith(variables['Build.SourceBranchName'], 'release-')) }}
1416
displayName: "Check the branch is a release branch"
1517

1618
- bash: |

0 commit comments

Comments
 (0)