Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document --affected flag and env vars #9046

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/repo-docs/reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ turbo run [tasks] [options] [-- [args passed to tasks]]

## Options

### `--affected`

Automatically filter to only packages that are affected by changes on the current branch.

By default the changes considered are those between `main` and `HEAD`.

- You can override `main` as the default base by setting `TURBO_SCM_BASE`.
- You can override `HEAD` as the default head by setting `TURBO_SCM_HEAD`.

```bash title="Terminal"
TURBO_SCM_BASE=development turbo run build --affected
```

<Callout type="warn">
Performing this comparison requires everything between base and head to exist in
the checkout. If the checkout is too shallow, then all packages will be
considered changed.
</Callout>

### `--cache-dir <path>`

Default: `.turbo/cache`
Expand Down
2 changes: 2 additions & 0 deletions docs/repo-docs/reference/system-environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ System environment variables are always overridden by flag values provided direc
| `TURBO_REMOTE_CACHE_TIMEOUT` | Set a timeout in seconds for `turbo` to get artifacts from [Remote Cache](/repo/docs/core-concepts/remote-caching). |
| `TURBO_REMOTE_ONLY` | Always ignore the local filesystem cache for all tasks. |
| `TURBO_RUN_SUMMARY` | Generate a [Run Summary](/repo/docs/reference/run#--summarize) when you run tasks. |
| `TURBO_SCM_BASE` | Base used by `--affected` when calculating what has changed from `base...head` |
| `TURBO_SCM_HEAD` | Head used by `-affected` when calculating what has changed from `base...head` |
| `TURBO_TEAM` | The account name associated with your repository. When using [Vercel Remote Cache](https://vercel.com/docs/monorepos/remote-caching#vercel-remote-cache), this is your team's slug. |
| `TURBO_TEAMID` | The account identifier associated with your repository. When using [Vercel Remote Cache](https://vercel.com/docs/monorepos/remote-caching#vercel-remote-cache), this is your team's ID. |
| `TURBO_TELEMETRY_MESSAGE_DISABLED` | Disable the message notifying you that [Telemetry](/repo/docs/telemetry) is enabled. |
Expand Down
Loading