I see posts asking for this since 2015.
Here’s the situation, as I understand things.
We have two options which are mutually exclusive:
- Run on every commit
- Run on every PR
There is no way to do both, if I understand correctly?
At our company, we have 3 main branches:
When a developer does a
feature/something_cool branch, it will typically get merged into
The following week,
develop gets branched into that week’s
Once that release branch has shipped, it gets merged into
So, I do want standard unit testing integrations to run when a PR is created for a branch.
But then, once the branch is promoted into
master (which can happen for cherrypicks, hotfixes, etc…) the receiving branch should run its integration.
If I set Circle to run on every commit, I can filter some branches to shortcircuit (i.e. cancel the job early) if there is no PR URL associated with it. However, once a branch then issues a PR, nothing happens. Creating a PR is not considered a “commit” and Circle does nothing.
If I set Circle to run on every PR, then merging those PRs into their respective branches does nothing because that merge has no PR any longer.
Again, I see people asking about this since 2015, and it seems very odd to me that 6 years later we only have this one-or-the-other solution. Therefore, I have my fingers crossed that there is something I’ve simply overlooked. Some new feature with 2.1 maybe, that lets me unify my commit-based and PR-based workflows. For example, if
when: could be used, as
when: pr-merged or something? Just spitballing here…