How to run command on each workplace, which has changes since last commit?

Issue

I am trying to run the command on workplaces, which were changed since last commit:

 yarn workspaces foreach --verbose --since --no-private npm info

My yarnrc.yml includes this setting to specify the previous commit

changesetBaseRefs:
  - HEAD~

But it still runs on all workspaces.

I tried checking changes with

yarn version check

And it shows the exact 2 packages that were changed.

Do you have any ideas on how to do it?

Solution

You need to add -R tag

yarn workspaces foreach --since --no-private -R npm info

Find packages via dependencies/devDependencies instead of using the workspaces field. Here you can read more: https://yarnpkg.com/cli/workspaces/foreach#options-R%2C-recursive

Answered By – Victoria Unizhona

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published