mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
Adjust Chromatic to run conditionally (#37050)
This commit is contained in:
49
.github/workflows/chromatic.yml
vendored
49
.github/workflows/chromatic.yml
vendored
@@ -1,31 +1,51 @@
|
|||||||
name: 'Chromatic'
|
name: 'Chromatic'
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- renovate/*
|
- renovate/*
|
||||||
- stable-*
|
- stable-*
|
||||||
paths:
|
|
||||||
- 'package.json'
|
|
||||||
- 'yarn.lock'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.jsx'
|
|
||||||
- '**/*.ts'
|
|
||||||
- '**/*.tsx'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.scss'
|
|
||||||
- '.github/workflows/chromatic.yml'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
chromatic:
|
pathcheck:
|
||||||
name: Run Chromatic
|
name: Check for relevant changes
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'mastodon/mastodon'
|
outputs:
|
||||||
|
changed: ${{ steps.filter.outputs.src }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
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
|
- name: Set up Javascript environment
|
||||||
uses: ./.github/actions/setup-javascript
|
uses: ./.github/actions/setup-javascript
|
||||||
|
|
||||||
@@ -35,7 +55,8 @@ jobs:
|
|||||||
- name: Run Chromatic
|
- name: Run Chromatic
|
||||||
uses: chromaui/action@v13
|
uses: chromaui/action@v13
|
||||||
with:
|
with:
|
||||||
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
|
|
||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||||
zip: true
|
zip: true
|
||||||
storybookBuildDir: 'storybook-static'
|
storybookBuildDir: 'storybook-static'
|
||||||
|
exitZeroOnChanges: false # Fail workflow if changes are found
|
||||||
|
autoAcceptChanges: 'main' # Auto-accept changes on main branch only
|
||||||
|
|||||||
Reference in New Issue
Block a user