From b1b871aebf5cdae0f5ae655e669c5fb0eb9f081d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Mon, 3 Apr 2023 13:41:33 +0900 Subject: [PATCH] ci(#10336): use Chromatic for checks --- .github/workflows/storybook.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 17bb2fd874..bc27c62ec7 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -5,7 +5,7 @@ on: branches: - master - develop - pull_request: + pull_request_target: jobs: build: @@ -40,22 +40,14 @@ jobs: id: chromatic uses: chromaui/action@v1 with: - exitZeroOnChanges: false projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} storybookBuildDir: storybook-static workingDir: packages/frontend - - name: Notify on changes - uses: actions/github-script@v6.4.0 - if: failure() - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.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: Compare on Chromatic + if: github.event_name == 'pull_request_target' + run: pnpm --filter frontend chromatic --exit-once-uploaded --patch-build ${{ github.head_ref }}...${{ github.base_ref }} + env: + CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - name: Upload Artifacts uses: actions/upload-artifact@v3 with: