Skip to content

GH Actions/unit-tests: don't run code coverage in forks #2568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

rodrigoprimo
Copy link
Collaborator

The unit-tests workflow runs code coverage for pushes to main and pull requests, but wasn't limited to this repo.

This resulted in failing builds for contributors who have actions enabled on their fork. The reason for the failure is that they don't have access to the CODECOV_TOKEN.

This commit changes the conditions on when to run the tests normally and when to run with code coverage to take the organisation where the repo lives into account. That should prevent the failing builds in forks.

Similar to #2542, which applied the same change to the quicktestworkflow.

The `unit-tests` workflow runs code coverage for pushes to `main` and pull requests, but wasn't limited to this repo.

This resulted in failing builds for contributors who have actions enabled on their fork. The reason for the failure is that they don't have access to the `CODECOV_TOKEN`.

This commit changes the conditions on when to run the tests normally and when to run with code coverage to take the organisation where the repo lives into account. That should prevent the failing builds in forks.
Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rodrigoprimo ! LGTM.

I wonder if we shouldn't improve the workflow organisation to only have code coverage in the unit-test.yml workflow - probably via a separate job, but that's for a future iteration.

@jrfnl jrfnl added this to the 3.2.x milestone Aug 5, 2025
@dingo-d dingo-d merged commit 067740b into WordPress:develop Aug 5, 2025
41 checks passed
@rodrigoprimo rodrigoprimo deleted the update-unit-test-workflow branch August 5, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants