Skip to content

feat: upload fork pull request coverage to Codecov - #254

Draft
ernst-dev wants to merge 2 commits into
mainfrom
feat/codecov-fork-upload
Draft

feat: upload fork pull request coverage to Codecov#254
ernst-dev wants to merge 2 commits into
mainfrom
feat/codecov-fork-upload

Conversation

@ernst-dev

@ernst-dev ernst-dev commented Aug 25, 2026

Copy link
Copy Markdown
Member

Change

Adds a thin workflow_run wrapper that calls the privileged reusable workflow in cloudscape-design/actions, restoring Codecov coverage for fork pull requests. Fork PRs run without secrets, so CODECOV_TOKEN is unavailable and the upload cannot happen from the build job.

This mirrors the existing deploy-fork-preview.yml wrapper in this repository — same filename convention, trigger shape, workflow-level permissions, job naming and secrets: inherit — so the fork-preview and fork-coverage flows now cover the same repositories. No with: is passed because the reusable workflow's artifact-name input defaults to coverage-report.

All privileged logic lives in cloudscape-design/actions; this file is only the rollout unit. It never checks out or executes fork code.

Verified for this repo, not assumed

The caller workflow's name: is exactly Build, lint and test, matching this wrapper's workflow_run.workflows entry. workflow_run matches on workflow name, so a mismatch would silently never fire.

coverage/ is confirmed as the correct output path: vite.config.unit.mjs sets coverage.enabled: true and no reportsDirectory, so vitest writes to its default ./coverage. Configured reporters are clover, lcov, html and json.

Rollout order

cloudscape-design/actions#131 has already landed (d3eca61 on main), so codecov-fork-upload.yml@main resolves and this wrapper has no pending prerequisite. It does not depend on cloudscape-design/actions#132 either: that PR only adds an optional coverage-artifact-name input for matrix callers, and the default this wrapper relies on is unchanged.

The upstream workflow uploads to Codecov for real, and runs with continue-on-error: true, so a failure there can never block a pull request. The attribution risk and the first-run checks are documented in #131; they are not duplicated here.

Must never be a required status check

This workflow deliberately does not run on merge_group (it only triggers on workflow_run of a pull request build). Adding it as a required status check would deadlock the merge queue.

Context: cloudscape-design/actions#131, cloudscape-design/build-tools#78.

The shared codecov-fork-upload workflow requests pull-requests: read for its
pull request resolver step. A called reusable workflow's permissions must be a
subset of the caller's, so granting only actions and contents made the call
fail workflow validation before any job ran.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant