Skip to content

Commit 2034065

Browse files
talissoncostaclaude
andcommitted
fix(ci): improve Chromatic workflow — path filter, auto-accept on main
Three fixes: 1. Run on push to main — establishes baselines when PRs merge. Without this, Chromatic has no main baseline and every PR shows all stories as "new changes". 2. autoAcceptChanges on main — automatically accepts all changes as the new baseline when merging to main. No manual review needed for the source of truth branch. 3. Narrow path filter — only trigger on component, style, theme, storybook, and documentation changes. E2E tests, configs, and other non-UI files no longer trigger Chromatic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e5fa9f commit 2034065

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/frontend-chromatic.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
name: Frontend Chromatic
22

33
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- frontend/web/components/**
8+
- frontend/web/styles/**
9+
- frontend/common/theme/**
10+
- frontend/documentation/**
11+
- frontend/.storybook/**
12+
- .github/workflows/frontend-chromatic.yml
413
pull_request:
514
types: [opened, synchronize, reopened, ready_for_review]
615
paths:
7-
- frontend/**
16+
- frontend/web/components/**
17+
- frontend/web/styles/**
18+
- frontend/common/theme/**
19+
- frontend/documentation/**
20+
- frontend/.storybook/**
821
- .github/workflows/frontend-chromatic.yml
922

1023
permissions:
@@ -14,7 +27,7 @@ jobs:
1427
chromatic:
1528
name: Chromatic
1629
runs-on: ubuntu-latest
17-
if: github.event.pull_request.draft == false
30+
if: github.event_name == 'push' || github.event.pull_request.draft == false
1831

1932
defaults:
2033
run:
@@ -43,3 +56,4 @@ jobs:
4356
exitZeroOnChanges: true
4457
exitOnceUploaded: true
4558
onlyChanged: true
59+
autoAcceptChanges: main

0 commit comments

Comments
 (0)