circleci-monorepo icon indicating copy to clipboard operation
circleci-monorepo copied to clipboard

Add fallback workfrow

Open tetienne opened this issue 3 years ago • 2 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?

tetienne avatar Feb 16 '21 16:02 tetienne

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).

dimadeveatii avatar Mar 12 '21 16:03 dimadeveatii

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

tetienne avatar Mar 12 '21 16:03 tetienne