From a280af36422c1840be6a421b1ceb70dd0956f09f Mon Sep 17 00:00:00 2001 From: Dominic Ayre Date: Mon, 9 Jan 2023 10:33:02 +0000 Subject: [PATCH] Fix running pipeline against PR manually --- .azure-pipelines-templates/deploy_aci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines-templates/deploy_aci.yml b/.azure-pipelines-templates/deploy_aci.yml index 936367900a2b..204b104293ab 100644 --- a/.azure-pipelines-templates/deploy_aci.yml +++ b/.azure-pipelines-templates/deploy_aci.yml @@ -22,9 +22,10 @@ jobs: set -ex RETRIES=500 HEAD_SHA=`git rev-parse HEAD` - if [ $(System.PullRequest.PullRequestId) != "" ]; then + if [ $(Build.SourceBranchName) == "merge" ]; then # If this is the case, we're running in a PR, and the SHA we really want is in the # commit message of the last commit (which merges it into target) + echo "Running in a PR, getting the SHA from the commit message" LAST_COMMIT=(`git log -1 --pretty=%B`) HEAD_SHA=${LAST_COMMIT[1]} fi