Skip to content

Commit

Permalink
Add CI trigger back to pipeline generator (#1410)
Browse files Browse the repository at this point in the history
* Add CI trigger back to pipeline generator
  • Loading branch information
mitchdenny authored Mar 9, 2021
1 parent deddf16 commit 1a5b477
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@ protected override async Task<bool> ApplyConventionAsync(BuildDefinition definit
}
}

var ciTrigger = definition.Triggers.OfType<ContinuousIntegrationTrigger>().SingleOrDefault();

if (ciTrigger == null)
{
definition.Triggers.Add(new ContinuousIntegrationTrigger()
{
SettingsSourceType = 2
});
hasChanges = true;
}
else
{
if (ciTrigger.SettingsSourceType != 2)
{
ciTrigger.SettingsSourceType = 2;
hasChanges = true;
}
}

return hasChanges;
}
}
Expand Down

0 comments on commit 1a5b477

Please sign in to comment.