Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,34 @@ jobs:
# times, and the nightly is what keeps asking. Chromatic answers "should
# this have changed?", which only makes sense once the answer to "did
# anything change by itself?" is no.
#
# `CHROMATIC_SHA`, and the branch and slug that have to travel with it,
# because on a `pull_request` event `GITHUB_SHA` is the *merge* commit
# GitHub builds for the run -- a commit that exists on no branch. Left
# alone, Chromatic posts `UI Tests` and `UI Review` there, where the pull
# request shows them (GitHub knows the merge commit is its) but a
# required status check cannot: those are read off the head commit,
# which is where every Actions job already reports. Measured on #187:
# twelve check runs on `5520f5f2`, three Chromatic statuses on the merge
# commit `aefcbe4`, no overlap.
#
# It also picks the wrong baseline. That merge commit has the latest
# build on main for an ancestor -- the pull request's own branch does
# not -- so every comparison is made against main rather than against
# what this branch last looked like.
#
# Chromatic's own answer is to run this on `push` instead, which for
# this workflow would mean the whole 20-minute sweep on every branch
# push, pull request or not. So: the documented alternative, verbatim,
# falling back to the push values on main.
#
- run: pnpm chromatic ${{ github.ref == 'refs/heads/main' && '--auto-accept-changes' || '--exit-zero-on-changes' }}
if: ${{ env.CHROMATIC == 'true' }}
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
CHROMATIC_SLUG: ${{ github.repository }}

#
# Build
Expand Down
Loading