Report the shot at the commit that has a branch - #190
Merged
Conversation
Chromatic posts `UI Tests` and `UI Review` on whatever commit the CLI is given, and on a `pull_request` event that is `GITHUB_SHA` -- the merge commit GitHub builds for the run, which exists on no branch. The pull request displays them anyway, so nothing looked wrong. But a required status check is read off the head commit, and on #187 the two sets never met: twelve Actions check runs on `5520f5f2`, three Chromatic statuses on the merge commit `aefcbe4`. Adding `UI Tests` to the ruleset today would have waited for a status that never lands there, on every pull request, forever. So hand Chromatic the head commit, plus the branch and slug that have to travel with it or the build attaches to the wrong ref. All three are empty on a push, where `GITHUB_SHA` is already the commit itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`github.repository` rather than the head repo's slug, and a fallback on each so a push to main keeps reporting where it always did. This is the snippet Chromatic's GitHub Actions guide gives for `pull_request` workflows, which is what this one is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groundwork for adding
UI Teststo the branch ruleset. It cannot be added today: the status never reaches the commit a required check is read from.Chromatic posts
UI TestsandUI Reviewon whatever commit the CLI is handed, and on apull_requestevent that isGITHUB_SHA-- the merge commit GitHub builds for the run, a commit that exists on no branch. GitHub Actions, by contrast, reports its check runs on the head commit. Measured on #187, they never meet:The pull request shows all of them together -- GitHub knows the merge commit is its -- so nothing looks wrong until you make one of them required, at which point every pull request waits forever on a status that lands somewhere else.
So hand Chromatic the head commit explicitly, plus the branch and slug that have to travel with it or the build attaches to the wrong ref. All three are empty on a push, where
GITHUB_SHAis already the commit itself.After this merges
chromatic-jobon an open pull request and check the status lands on the head:UI Teststo theBasicruleset as a required status check.馃 Generated with Claude Code