Inconsistent ignoring builds in Monorepo

I’ve tried to follow the many different examples in ignoring builds based on changes to certain folders and I don’t seem to be able to create a consistent experience.

It sometimes cancels correctly, sometimes doesn’t and I can’t figure out whats is causing either of them.

Some context we are a Design System monorepo and the root directory is the root of the repo because we use the latest local versions of packages to build our assets with.

What I want to be able to do is say “only do a preview deploy when we have changes in two directories that are different than in the main branch”. I have tried different combinations of the following.

  # only do a preview Preformatted text deply when there is a website change
  ignore = "git diff --quiet main HEAD -- packages/paste-website packages/paste-theme-designer"

I’ve tried git diff --quiet HEAD^ HEAD sub_dir/ from this page File-based configuration | Netlify Docs and the blog How to Ignore Builds - Optimize your Netlify Build Times. Neither work successfully all the time. Sometimes it’s successful in detecting that there was no changes and cancels the builds, other times it just builds a deplopyment regardless

What am I doing wrong?

Hey there, @SiTaggart :wave:

Thanks for reaching out, and welcome to the Netlify Forums :netliconfetti:

It looks like this thread has been a bit quiet since you last posted. Are you still encountering this issue? If so, please share your Netlify site name, as well as any additional debugging steps have you taken this past week?