diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 41eca21f4..02abf9745 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -19,16 +19,15 @@ jobs: - name: Install and Build 🔧 run: yarn - name: Publish to Chromatic + if: github.ref != 'refs/heads/main' uses: chromaui/action@v1 id: chromatic - # Chromatic GitHub Action options with: token: ${{ secrets.GITHUB_TOKEN }} onlyChanged: true - # 👇 Chromatic projectToken, refer to the manage page to obtain it. projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} autoAcceptChanges: 'main' - exitZeroOnChanges: false + exitZeroOnChanges: true exitOnceUploaded: true buildScriptName: build-storybook:chromatic - name: Add Chromatic link to PR @@ -37,3 +36,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: msg: "Chromatic Storybook: [${{ steps.chromatic.outputs.storybookUrl }}](${{ steps.chromatic.outputs.storybookUrl }})" + - name: Publish to Chromatic and auto accept changes + if: github.ref == 'refs/heads/main' + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + autoAcceptChanges: true