In Chromatic github workflow, how can I accept all changes automatically using the CLI option --auto-accept-changes if the branch is main?
I am using the following github chromatic workflow to deploy the components of my app in chromatic:
# .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on: push
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: yarn
# Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}
# Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
The branch detection appears in the docs, but Im not sure how to use it in my yml file, since my action is just yarn.
You have
autoAcceptChangeswhere you can define flag or branch nameso it should be: