Skip to content

Commit

Permalink
CI: avoid duplicate runs for secondary branches on main repo (ECP-War…
Browse files Browse the repository at this point in the history
…pX#5394)

The fix introduced in ECP-WarpX#5308 was not correct for Azure pipelines.

In GitHub Actions we trigger a run on the `push` event only for the
`development` branch.

The Azure equivalent of that is triggering a run on the `trigger` event
only for the `development` branch. However, since the `trigger` 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 the
`pr` event instead, unlike what I did for GitHub actions where the
`push` 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 branch
`pre-commit-ci-update-config` in the main repo (instead of a fork).

The new setup is tested in ECP-WarpX#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.
  • Loading branch information
EZoni authored and dpgrote committed Oct 23, 2024
1 parent 1926064 commit 01b8065
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
pool:
vmImage: 'ubuntu-20.04'

pr:
autoCancel: true
drafts: false
trigger:
branches:
include:
- development
pr:
autoCancel: true
drafts: false
paths:
exclude:
- Docs
Expand Down

0 comments on commit 01b8065

Please sign in to comment.