diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 374e44e297..55ecda39e4 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -37,9 +37,23 @@ jobs: env: NODE_OPTIONS: "--max_old_space_size=7168" - name: Publish to Chromatic - run: "pnpm --filter frontend chromatic -d storybook-static || :" + id: chromatic + uses: chromaui/action@v1 env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + exitZeroOnChanges: false + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + - name: Notify on changes + uses: actions/github-script@v6.4.0 + if: failure() + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Chromatic has detected ${{ steps.chromatic.outputs.changeCount }} changes in the Storybook. [Check it out](${{ steps.chromatic.outputs.url }}).' + }) - name: Upload Artifacts uses: actions/upload-artifact@v3 with: