-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f952c91
commit f1d0fda
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |