From ae5c61148e742b0591cf674c3821faaaaae7bc1f Mon Sep 17 00:00:00 2001 From: Junjie Zhang Date: Thu, 14 Nov 2024 08:02:24 +0000 Subject: [PATCH 1/2] fix: add start and end symbols for source branch validation --- .pipelines/templates/.builder-release-template-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/.builder-release-template-windows.yaml b/.pipelines/templates/.builder-release-template-windows.yaml index 779ca8f4170..3a0cbc99793 100644 --- a/.pipelines/templates/.builder-release-template-windows.yaml +++ b/.pipelines/templates/.builder-release-template-windows.yaml @@ -11,7 +11,7 @@ steps: else echo "This is a release build triggered from the release pipeline" - echo "$(Build.SourceBranch)" | grep -E 'windows/v[[:digit:]]{8}' + echo "$(Build.SourceBranch)" | grep -E '^windows/v[[:digit:]]{8}$' if (( $? != 0 )); then echo "The branch $(Build.SourceBranch) is not release branch. Please use the release branch. Release branch name format: windows/vYYYYMMDD." exit 1 From 2318c99bbd4cd1d15f93f99a62b85d9a12a6a8b9 Mon Sep 17 00:00:00 2001 From: Junjie Zhang Date: Thu, 14 Nov 2024 08:22:07 +0000 Subject: [PATCH 2/2] fix: fix bug --- .pipelines/templates/.builder-release-template-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/.builder-release-template-windows.yaml b/.pipelines/templates/.builder-release-template-windows.yaml index 3a0cbc99793..b33288eab9c 100644 --- a/.pipelines/templates/.builder-release-template-windows.yaml +++ b/.pipelines/templates/.builder-release-template-windows.yaml @@ -11,7 +11,7 @@ steps: else echo "This is a release build triggered from the release pipeline" - echo "$(Build.SourceBranch)" | grep -E '^windows/v[[:digit:]]{8}$' + echo "$(Build.SourceBranch)" | grep -E '^refs/heads/windows/v[[:digit:]]{8}$' if (( $? != 0 )); then echo "The branch $(Build.SourceBranch) is not release branch. Please use the release branch. Release branch name format: windows/vYYYYMMDD." exit 1