vercel-ignore
v1.0.2
Published
Ignore command for Vercel's "Ignored Build Step"
Downloads
456
Readme
vercel-ignore
To get started, add the following command as your Ignored Build Step to skip builds if no changes happened in the Root Directory:
npx vercel-ignore
The command executes git diff
to compare the changes between the commit in the last successful deployment and the current one.
This is intended for projects that have a Root Directory configured and are not under a monorepo. If you're using a Monorepo please use turbo-ignore instead.
Usage
npx vercel-ignore [paths...]
Executing vercel-ignore
without any paths will run the following command:
git diff --quiet <last-sha> HEAD -- .
Where <last-sha>
is the last successful deployment's commit SHA and .
will look for matches in the working directory, which is the Root Directory set in settings.
If you want to ignore changes for different paths, you can pass them as arguments:
npx vercel-ignore :/examples/hello-world :/examples/hello-world-typescript
The command above will execute:
git diff --quiet <last-sha> HEAD -- :/examples/hello-world :/examples/hello-world-typescript
Where :/
is a top magic signature to start the match from the git root. Otherwise the match will happen relative to the working directory.
FAQ
When should I use this?
If your repo has multiple, independent projects that can't be in a monorepo, like is the case for the Vercel Examples repository, you can use this to skip builds for projects that didn't change.
Should I use this instead of turbo-ignore?
No. If your project is part of a monorepo you should use turbo-ignore instead.