From 151ea0288ae95f5def0cbf771fe22eeabc1f3ed5 Mon Sep 17 00:00:00 2001 From: Brett Logan Date: Sun, 1 Dec 2019 12:00:22 -0500 Subject: [PATCH] [FAB-17133] Add branch to AZP trigger Add the branch name, i.e., refs/pull/3/merge to the AZP trigger. Without the branch it attempts to checkout the commit which does not exist in the repo, as it comes from the remote branch of the user. This makes the checkout use refs/remote/pull/3/merge which resolves correctly to the users repo. Signed-off-by: Brett Logan --- .github/workflows/trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger.yml b/.github/workflows/trigger.yml index 4c9805d0dde..bd820c9f883 100644 --- a/.github/workflows/trigger.yml +++ b/.github/workflows/trigger.yml @@ -35,7 +35,7 @@ jobs: runs=$(az pipelines build list --project ${project} | jq -c ".[] | select(.sourceVersion | contains(\"${sha}\"))" | jq -r .status | grep -v completed | wc -l) if [[ $runs -eq 0 ]]; then - az pipelines build queue --commit-id ${sha} --project ${project} --definition-name Pull-Request + az pipelines build queue --branch refs/pull/${pr_number}/merge --commit-id ${sha} --project ${project} --definition-name Pull-Request curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST -d '{"body": "AZP build triggered!"}' "${comment_url}" else curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST -d '{"body": "AZP build already running!"}' "${comment_url}"