Skip to content

Commit

Permalink
[FAB-17133] Add branch to AZP trigger
Browse files Browse the repository at this point in the history
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 <Brett.T.Logan@ibm.com>
  • Loading branch information
lindluni authored and mastersingh24 committed Dec 2, 2019
1 parent da8b99c commit 151ea02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 151ea02

Please sign in to comment.