CI: avoid duplicate runs for secondary branches on main repo #5394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fix introduced in #5308 was not correct for Azure pipelines.
In GitHub Actions we trigger a run on the
push
event only for thedevelopment
branch.The Azure equivalent of that is triggering a run on the
trigger
event only for thedevelopment
branch. However, since thetrigger
event was completely absent from the Azure pipeline file (that is, the default setup was being used), I had erroneously added the filter branch to thepr
event instead, unlike what I did for GitHub actions where thepush
was exposed in the YAML files.This was originally aimed at avoiding duplicate runs for "individual CI" when
pre-commit
opens a pull request by pushing to a secondary branchpre-commit-ci-update-config
in the main repo (instead of a fork).The new setup is tested in #5393, where I copied these changes and where one can see that a commit pushed to that PR does not trigger an "individual CI" Azure pipeline anymore, but only a "PR automated" one.
Hopefully this is correct for the merge commits that get pushed to
development
once a PR is closed, but we'll be able to test this only after merging a PR.