I have a chained 2 builds scenario setup in VSTS.
I have a CI build, called 'Sync VSTS to GitHub' which runs two steps:
A powershell command which pushes the changes from that commit to GitHub.
Trigger another build, which compiles the solution, runs tests, deployments etc. (lets call it 'Proper Build')
This Sync VSTS to GitHub build has a trigger which detects when a push was made. That executes all OK.
The second build, the 'Proper Build' has no CI triggers defined. It is only supposed to be triggered manually (or rather by the 'Sync VSTS to GitHub' build).
What happens is that every time a push is made in Visual Studio, the 'Sync VSTS to GitHub' build is called. That succeeds, and then calls the Proper Build. And for some reason, this build is queued twice for the same changeset!
This second build is added after the first one runs for a short while:
Suddenly a wild build appears:
The only difference that I see between the builds is the user on behalf of which the build is triggered:
What is particularly weird is that this does not happen when the build is queued manually from VSTS (without a new changeset). In such scenario, each build is triggered once.
The build task that triggers the Proper Build is this one: https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks
This is how I configure it (I tried setting the highlighted option to different value, no effect).
To confirm - when this task is disabled, then the 'Proper Build' is not triggered at all (as expected)
Any idea how to avoid this duplication?