Repository navigation
ci: let maintainers run Chromatic for fork PRs via a label - #3273
Merged
Merged
Conversation
interactivellama
force-pushed
the
ci/chromatic-external-label
branch
3 times, most recently
from
October 30, 2026 22:11
c1c931d to
115a7bd
Compare
Fork PRs get no Chromatic run from the push workflow. Add a pull_request_target workflow that runs Chromatic when a user who can edit labels (triage access or higher) adds the run-chromatic label, pinned to the labeled head SHA, and removes the label on every PR synchronize so new commits need re-approval. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
interactivellama
force-pushed
the
ci/chromatic-external-label
branch
from
October 30, 2026 22:17
115a7bd to
fe5b010
Compare
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.
Summary
Chromatic only runs
on: push, so PRs from forks get no visual review (no secrets, no push event in this repo). This adds two workflows,chromatic-external.yml(label added) andchromatic-external-remove-label.yml(PR synchronize):run-chromaticlabel to a fork PR. The job checks out the PR head SHA from the fork and publishes to Chromatic.synchronize(new push to the PR), the label is removed, so new commits must be re-reviewed and re-labeled.Security notes
pull_request_targetexposesCHROMATIC_PROJECT_TOKENwhile building fork code, so the guards matter:run-chromatic.permissions: {}at top level,contents: readfor the run job,pull-requests: writeonly for label removal;persist-credentials: false.package.json/scripts) before labeling, sincenpm ciand the Storybook build execute PR code.Before merge / after merge
run-chromaticlabel in the repo.CHROMATIC_PROJECT_TOKENis available topull_request_targetruns.pull_request_targetworkflows run from the default branch, so this can only be exercised on a fork PR after merging.Also documents the flow in CONTRIBUTING.md.