[ci] Fix pipeline 'Check if vstest is needed.' issue. (#15958)
Why I did it Line:7 will exit when k8s file didn't change. Use 'System.PullRequest.TargetBranchName' instead of 'System.PullRequest.TargetBranch'. Because git server in AzDevOps don't support 'System.PullRequest.TargetBranch'. Work item tracking Microsoft ADO (number only): 24636791 How I did it How to verify it
This commit is contained in:
parent
dc139cfc32
commit
104ae5d185
@ -2,10 +2,9 @@ steps:
|
|||||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||||
- script: |
|
- script: |
|
||||||
set -ex
|
set -ex
|
||||||
tar_branch=origin/$(System.PullRequest.TargetBranch)
|
tar_branch=origin/$(System.PullRequest.TargetBranchName)
|
||||||
# Check if k8s master entrance script is changed
|
# Check if k8s master entrance script is changed
|
||||||
k8s_master_changed=$(git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh)
|
if ! git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
|
||||||
if [ -z "$k8s_master_changed" ]; then
|
|
||||||
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=n"
|
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=n"
|
||||||
else
|
else
|
||||||
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=y"
|
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=y"
|
||||||
|
Reference in New Issue
Block a user