Skip to content

Commit

Permalink
add FAQ for overring branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
winkerVSbecks committed Oct 18, 2024
1 parent f952c91 commit f1d0fda
Showing 1 changed file with 25 additions and 0 deletions.
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, you can set the branch name directly setting `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
```

0 comments on commit f1d0fda

Please sign in to comment.