Improve the PR build version (#7381)

Why I did it
Improve the version of the Pull Request build by changing the local branch name.

How I did it
Change the default branch name merge to [target_branch_name]-[pullrequestid].

How to verify it
For official build, the version is not changed.
For pull request build, the version as below:
This commit is contained in:
xumia 2021-04-23 10:24:00 +08:00 committed by GitHub
parent 39d877c1ad
commit e8582ac6b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,9 @@ jobs:
submodules: recursive
displayName: 'Checkout code'
- script: |
git checkout -b $(Build.SourceBranchName)
BRANCH_NAME=$(Build.SourceBranchName)
[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
git checkout -b $BRANCH_NAME
sudo modprobe overlay
sudo apt-get install -y acl
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"