Skip to content

ci(frontend): skip Chromatic on fork PRs#7823

Merged
talissoncosta merged 1 commit into
mainfrom
ci/chromatic-skip-forks
Jun 19, 2026
Merged

ci(frontend): skip Chromatic on fork PRs#7823
talissoncosta merged 1 commit into
mainfrom
ci/chromatic-skip-forks

Conversation

@talissoncosta

Copy link
Copy Markdown
Contributor

Changes

Chromatic fails with ✖ Missing project token on every community / fork PR (e.g. #7733). GitHub deliberately withholds repo secrets from pull_request runs originating from forks, so CHROMATIC_PROJECT_TOKEN is empty and the job can't run.

This guards the chromatic job to run only for same-repo PRs and pushes:

&& (github.event_name == 'push'
  || github.event.pull_request.head.repo.full_name == github.repository)

Fork PRs now skip Chromatic instead of showing a spurious red check. Visual coverage isn't lost — the existing post-merge push: [main] run executes Chromatic with full secrets (the same fallback the workflow already relied on for Dependabot).

This extends the existing Dependabot handling to all forks, since it's the same root cause (no secret access on fork runs).

How did you test this code?

  • Validated the workflow YAML parses and the if evaluates correctly for each case: push → runs, same-repo PR → runs, fork PR → skips, Dependabot → skips.
  • The full fork-skip path only manifests on an actual fork PR; this PR (same-repo) still runs Chromatic, which is the intended behaviour.

@talissoncosta talissoncosta requested a review from a team as a code owner June 18, 2026 13:02
@talissoncosta talissoncosta requested review from emyller and removed request for a team June 18, 2026 13:02
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 19, 2026 11:46am
flagsmith-frontend-preview Ignored Ignored Preview Jun 19, 2026 11:46am
flagsmith-frontend-staging Ignored Ignored Preview Jun 19, 2026 11:46am

Request Review

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7823 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7823 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7823 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-7823 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7823 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7823 Finished ✅ Results

@github-actions github-actions Bot added the ci-cd Build, test and deployment related label Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (5266950) to head (3b4cc56).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7823   +/-   ##
=======================================
  Coverage   98.59%   98.59%           
=======================================
  Files        1467     1467           
  Lines       57332    57332           
=======================================
  Hits        56525    56525           
  Misses        807      807           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.9 seconds
commit  5aa91ab
info  🔄 Run: #17636 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  37 seconds
commit  5aa91ab
info  🔄 Run: #17636 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  45.3 seconds
commit  5aa91ab
info  📦 Artifacts: View test results and HTML report
🔄 Run: #17636 (attempt 1)

Failed tests

firefox › tests/project-permission-test.pw.ts › Project Permission Tests › Project-level permissions control access to features, environments, audit logs, and segments @enterprise

### Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  41.6 seconds
commit  3b4cc56
info  🔄 Run: #17671 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  45 seconds
commit  3b4cc56
info  🔄 Run: #17671 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  32.8 seconds
commit  3b4cc56
info  🔄 Run: #17671 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  40.7 seconds
commit  3b4cc56
info  🔄 Run: #17671 (attempt 1)

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@talissoncosta talissoncosta requested a review from Zaimwa9 June 18, 2026 16:45
@talissoncosta talissoncosta removed the request for review from emyller June 18, 2026 16:45
@talissoncosta talissoncosta assigned Zaimwa9 and unassigned emyller and Zaimwa9 Jun 18, 2026
GitHub withholds repo secrets from pull_request runs originating from forks,
so CHROMATIC_PROJECT_TOKEN is empty and the job fails with 'Missing project
token' on every community PR (e.g. #7733). Guard the job to run only for
same-repo PRs and pushes; main's post-merge push still runs Chromatic with
full secrets, so coverage isn't lost.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@talissoncosta talissoncosta force-pushed the ci/chromatic-skip-forks branch from 5aa91ab to 3b4cc56 Compare June 19, 2026 11:46
@github-actions github-actions Bot added ci-cd Build, test and deployment related and removed ci-cd Build, test and deployment related labels Jun 19, 2026
@talissoncosta talissoncosta merged commit abfdc80 into main Jun 19, 2026
36 of 37 checks passed
@talissoncosta talissoncosta deleted the ci/chromatic-skip-forks branch June 19, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd Build, test and deployment related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants