ci(chromatic): skip Chromatic on Dependabot PRs#7425
Draft
talissoncosta wants to merge 1 commit intomainfrom
Draft
ci(chromatic): skip Chromatic on Dependabot PRs#7425talissoncosta wants to merge 1 commit intomainfrom
talissoncosta wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Dependabot PRs run with a separate secrets store (Settings → Secrets → Dependabot) that doesn't include CHROMATIC_PROJECT_TOKEN, so the action aborts with "Missing project token". Skip the job for Dependabot — main's post-merge push runs Chromatic with full secrets, so any visual regression a bump introduces is still caught one merge later. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4b84781 to
349efa7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7425 +/- ##
=======================================
Coverage 98.44% 98.44%
=======================================
Files 1398 1398
Lines 52646 52646
=======================================
Hits 51826 51826
Misses 820 820 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Follow-up to a question raised on #7375 by @Zaimwa9 — Chromatic CI is currently failing on every Dependabot npm PR with
✖ Missing project token.TL;DR. Dependabot PRs can't read
CHROMATIC_PROJECT_TOKEN(separate secrets store), so Chromatic fails with "Missing project token". This skips Chromatic on Dependabot PRs only. main's post-merge push still runs Chromatic with full secrets, so coverage isn't lost.Cause
GitHub runs Dependabot PRs with a separate secrets store (
Settings → Secrets and variables → Dependabot) that doesn't include theCHROMATIC_PROJECT_TOKENwe have in the regular Actions secrets. The Chromatic action then aborts withMissing project token.This isn't a misconfiguration — it's the platform protecting us. If Actions secrets were exposed to Dependabot PRs, a malicious
package-lock.jsonpoisoned dep could exfiltrate them viapostinstallscripts (see e.g. the Codecov 2021 incident for the canonical version of this attack).Confirmed via the workflow logs of #7375's last run:
Fix
Skip the Chromatic job when
github.actor == 'dependabot[bot]':When the Dependabot PR eventually merges into
main, the push event runs Chromatic with the parent's secrets — so any visual regression a bump introduces is still caught, one merge later instead of pre-merge. Trade-off accepted given dep bumps rarely change visual output.Alternatives considered
CHROMATIC_PROJECT_TOKENto Dependabot secrets store. Would make Chromatic run on Dependabot PRs the same as any other. Rejected: widens the secret-access surface for the bot whose PRs are most likely to bring in arbitrary transitive deps.pull_request_targetevent. Foot-gun. Gives PR code access to the base repo's secrets — exactly the attack vector the platform-level isolation is preventing. Hard pass.How did you test this code?
github.actorbehaviour for Dependabot PRs (Actions context docs, Dependabot secret-isolation behaviour).