ci: required chromatic approvals on merges#7770
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
f55fa3f to
7fd8fd6
Compare
There was a problem hiding this comment.
Code Review — Chromatic CI enforcement
This PR makes Chromatic a blocking check by setting exitZeroOnChanges: false and adds environment variables to help Chromatic correctly identify the branch/commit being tested. The goal is sound — keeping main visually clean by requiring approval of any storybook changes before merge.
Critical (Must Fix)
CHROMATIC_SHA uses github.ref as a fallback, which is not a SHA (see inline comment). For push-to-main and release branch runs, this passes a ref string like refs/heads/main to Chromatic instead of a commit hash, which will likely cause Chromatic to fail to associate the build correctly. Should be github.sha.
Suggestions
Checkout uses branch name instead of commit SHA (see inline comment). github.event.pull_request.head.ref is a branch name — checking out by name rather than by head.sha introduces a race condition where a concurrent push can cause the job to test a different commit than the one that triggered it. Using head.sha is the safer, deterministic approach Chromatic recommends.
Nice to Have
- The
exitZeroOnChanges: falsecomment says "Fail workflow if changes are found" — it may be worth clarifying that this means unreviewed visual changes, not any diff changes, so future readers aren't confused about what triggers a failure.
Greptile SummaryThis PR updates the Chromatic visual-regression workflow to enforce story approvals before merging by setting
Confidence Score: 3/5The P1 CHROMATIC_SHA bug will cause Chromatic to receive a branch ref string instead of a commit SHA on push-to-main runs, breaking baseline association; fix the fallback before merging. The core feature (enforcing approvals on PRs via exitZeroOnChanges: false) is sound, but the CHROMATIC_SHA fallback to github.ref instead of github.sha is a concrete logic error that will silently break Chromatic build tracking on every push to main and release branches. .github/workflows/chromatic.yml — specifically the CHROMATIC_SHA environment variable fallback on line 75. Important Files Changed
Reviews (1): Last reviewed commit: "feat: required approvals on ci merges" | Re-trigger Greptile |
fix: adding env variables chore: accepting main changes chore: clean ups chore: revert fix
7fd8fd6 to
9e423eb
Compare
Ticket []
Description Of Changes
Adds a requirement to approve changes to storybook components before merging.
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works