Merge pull request #1076 from kmycode/upstream-20251217 #141
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Chromatic' | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches-ignore: | |
| - renovate/* | |
| - stable-* | |
| jobs: | |
| pathcheck: | |
| name: Check for relevant changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.filter.outputs.src }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| src: | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - '**/*.js' | |
| - '**/*.jsx' | |
| - '**/*.ts' | |
| - '**/*.tsx' | |
| - '**/*.css' | |
| - '**/*.scss' | |
| - '.github/workflows/chromatic.yml' | |
| chromatic: | |
| name: Run Chromatic | |
| runs-on: ubuntu-latest | |
| needs: pathcheck | |
| if: github.repository == 'mastodon/mastodon' && needs.pathcheck.outputs.changed == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Javascript environment | |
| uses: ./.github/actions/setup-javascript | |
| - name: Build Storybook | |
| run: yarn build-storybook | |
| - name: Run Chromatic | |
| uses: chromaui/action@v13 | |
| with: | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| zip: true | |
| storybookBuildDir: 'storybook-static' | |
| exitZeroOnChanges: false # Fail workflow if changes are found | |
| autoAcceptChanges: 'main' # Auto-accept changes on main branch only |