104ae5d185
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
19 lines
911 B
YAML
19 lines
911 B
YAML
steps:
|
|
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
|
- script: |
|
|
set -ex
|
|
tar_branch=origin/$(System.PullRequest.TargetBranchName)
|
|
# Check if k8s master entrance script is changed
|
|
if ! git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
|
|
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=n"
|
|
else
|
|
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=y"
|
|
fi
|
|
git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0
|
|
git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0
|
|
set +x
|
|
echo "Skip vstest jobs"
|
|
echo "##vso[task.setvariable variable=SKIP_VSTEST;isOutput=true]YES"
|
|
name: SetVar
|
|
displayName: "Check if vstest is needed."
|