In our development, we use a master branch and a release branch. The release branch is protected, and only pull-requests can change the release branch. We have an application that fetches a build artifact from a library pipeline.
I used to have two CI pipelines, one that triggers on changes on master, and one that triggers on PR to release. This works fine, but these two pipelines are almost identical, except that one fetches the library artifact from a master pipeline, and the other from the release pipeline, to compile the application.
To make this more maintainable, I wanted to merge these pipelines and have triggers like this:
# CI triggers
trigger:
batch: true # To reduce the number of runs to start. Will batch all commits that happen during an active run
branches:
include:
- master
# PR triggers
pr:
branches:
include:
- master
- release
The triggers and the mechanisms to fetch the correct artifact work fine.
When the compilation using the release artifact fails, the PR on git correctly shows this. However, when a pipeline run triggered by the batchedCI on master succeeds, the PR shows that the run is succesfull (which is not true when using the release artifacts).
How can I use this single pipeline, and have the git PR only look at the pipeline runs triggered by that PR, ignoring those triggered by the BatchedCI on master?