turbo-ignore is a command-line interface (CLI) package designed to optimize CI/CD pipelines, particularly on platforms like Vercel, by selectively skipping builds for projects within a Turborepo monorepo that have not been affected by recent code changes. It operates by analyzing the Turborepo dependency graph and comparing the current commit with a previous reference to determine if a given workspace or its dependencies have changed. If no changes are detected, it exits with a code that signals the CI/CD system (e.g., Vercel's Ignored Build Step) to skip the build, saving time and resources. As of version 2.9.6 (and later canary releases), `turbo-ignore` is *deprecated*. Users are now advised to migrate to `turbo query affected` for more granular and precise task-level change detection directly within Turborepo. While still functional, it no longer receives updates, and its functionality is superseded by built-in `turbo` commands.
npm install turbo-ignoreNo compatibility data collected yet for this library.
This demonstrates how to use `turbo-ignore` in a CI/CD environment, particularly within Vercel's 'Ignored Build Step', to determine if the current project (or a specified workspace) has changes that warrant a build.
Migrate your CI/CD configurations from `npx turbo-ignore` to use `turbo query affected` commands. Refer to the official Turborepo migration guide for detailed instructions.
Always provide a `--fallback` reference to a stable branch (e.g., `--fallback=HEAD^1` or `--fallback=remotes/origin/main`) to ensure comparison against an existing deployment baseline. This helps `turbo-ignore` make accurate decisions even on new branches.
While `turbo-ignore` is deprecated, this issue is a known limitation. For more granular control over cache invalidation and affected detection, transitioning to `turbo query affected` is the recommended long-term solution.
Ensure your CI environment has access to the full git history and necessary authentication (e.g., a deploy key) to compare against remote refs. Provide explicit `--fallback` references to ensure correct operation.
Ensure that your `turbo` and `turbo-ignore` versions are compatible. Clear your Vercel build cache. If the issue persists, consider upgrading your Turborepo setup or migrating away from `turbo-ignore` as it's deprecated.
To prevent unnecessary builds, use the `--fallback` flag to point to a stable reference (e.g., `HEAD^1` for the previous commit or `remotes/origin/main` for the main branch). This allows `turbo-ignore` to compare against a known state. For example: `npx turbo-ignore --fallback=HEAD^1`.
Add `turbo-ignore` as a `devDependency` to your root `package.json` (`npm install -D turbo-ignore` or `yarn add -D turbo-ignore` or `pnpm add -D turbo-ignore`). This ensures it's installed as part of your `npm ci` or `yarn install` step, making `npx` use the locally installed version.