How to use ignore build in netlify.toml


I am new in monorepo.
I have a one monorepo and it is hosted on netlify

|--- netlify.toml
|--- files.js
|     |----app1
|     |     |--- netlify.toml
|     |
|     |----app2
|            |--- netlify.toml
|      |-----lib1
|      |      |---filename.js
|      |
|      |-----lib2
|             |---fileeename.js

My folder is looks something like this

What I tried on root netlify.toml

  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./libs/"

but not worked

what I tried on app1 and app2

  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../../libs/"

But this also doesn’t work.

What I want to achieve

If I change something on root folder or libs folder then netlify should build for every website.
But If I change app1 then It should only build for app1 and ignore app2 or other applications.
If I change app2 then It should only build for app2 and ignore other builds.


  1. How to achieve that?
  2. Is there any example project similar like this in GitHub?
  3. where to place ignore codes in root netlify.toml or on app1 or app2 netlify.toml?

Please help me!


When you say, it did not work, does it mean that the build was triggered or was it not triggered?

Also, can you share the site name?

It means build was triggered.

But I want not to trigger.

I think now my problem is solved.
But I don’t know which method worked for me.
I can share files

root netlify.toml

package = "@netlify/plugin-nextjs"

  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ./libs/"

subdirectory netlify.toml

  ignore = "git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../../libs/"

I don’t know which will work for you.
But maybe this can solve your issue & save your time. If you are facing similar types of issue.