From 5143f3372ca1cd436d25d5321fba2cd9264eaacf 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: Sun, 2 Apr 2023 21:50:02 +0900 Subject: [PATCH] ci(#10336): notify on changes --- .github/workflows/storybook.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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: