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

add FAQ for overring branch name #586

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
25 changes: 25 additions & 0 deletions src/content/troubleshooting/faq/override-branch-name.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: "../../../layouts/FAQLayout.astro"
sidebar: { hide: true }
title: Override the branch name for certain CI providers
section: ci
---

# Override the branch name if Chromatic is unable to identify the correct one on CI?

In some cases, Chromatic's automatic CI detection is unable to figure out the branch name associated with a build. You'll see a message like this in your build logs:

```bash
Removing unknown owner prefix from branch name. You may wish to set the branch directly to avoid incorrect values.
```

In this case, set the branch name directly by configuring the `CHROMATIC_SHA`, `CHROMATIC_BRANCH`, and `CHROMATIC_SLUG` environment variables. For example, in a GitHub Actions workflow:

```yaml
- name: Chromatic
env:
CHROMATIC_SHA: ${{ github.sha }}
CHROMATIC_BRANCH: ${{ github.ref }}
CHROMATIC_SLUG: ${{ github.repository }}
run: npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN
```
Loading