labs42io / circleci-monorepo

An example of monorepo with CircleCI using conditional workflows and pipeline parameters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add fallback workfrow

tetienne opened this issue · comments

Hi,

Many thanks for great project. I’m using the v2.

Is it possible to add a default workflow if a modified file does not match any of the packages defined in packages.json?

Hi @tetienne, thank you! We're using v2 as well and it works fine.

But what would be the usage of a fallback workflow? If you need a workflow that is just triggered on each change, you add one in CircleCI without parameter conditions (same as the ci workflow here).

In our monorepo, we have some files at the root of the repository, or even folders not in any packages such as .github or .circleci for instance.
So when a file in one of this folders is modified, it does not match any packages (in /packages/*), and no build are launched.

But few times after my question, I met an other issue with this script when I do some rebase interactive (git rebase -i) on a branch to squash or rename my commits. The script was totally lost, and does not detect any new modification on my branch.
I end up creating a similar script retrieving the modified files with the Github API: https://docs.github.com/en/rest/reference/pulls#list-pull-requests-files