aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-05-12 16:01:12 -0700
committerGravatar MarkKoz <[email protected]>2019-05-12 16:01:12 -0700
commit27af05b05b5c5bc0974ed61bf75f93a3b42280df (patch)
tree755ea947be7ae0e3f0d5d0fb87a2565063d12c18
parentRetrieve previous build's commit using a REST API (diff)
Ensure branches are prefixed with refs/heads/
-rw-r--r--azure-pipelines.yml3
1 files changed, 3 insertions, 0 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 883f554..3df683b 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -43,6 +43,9 @@ jobs:
command: 'login'
- script: |
+ SYSTEM_PULLREQUEST_TARGETBRANCH=refs/heads/"${SYSTEM_PULLREQUEST_TARGETBRANCH#refs/heads/}"
+ BUILD_SOURCEBRANCH=refs/heads/"${BUILD_SOURCEBRANCH#refs/heads/}"
+
REQUEST_URL="https://dev.azure.com/python-discord/${SYSTEM_TEAMPROJECTID}/_apis/build/builds?queryOrder=finishTimeDescending&resultFilter=succeeded&\$top=1&repositoryType=${BUILD_REPOSITORY_PROVIDER}&repositoryId=${BUILD_REPOSITORY_NAME}&branchName=${SYSTEM_PULLREQUEST_TARGETBRANCH:-BUILD_SOURCEBRANCH}&api-version=5.0"
echo "Retrieving previous build's commit using $REQUEST_URL"