Skip to content

Commit 38c6569

Browse files
committed
Avoid coverage upload for merge up pull requests
When there are no conflicts between branches, we create pull requests where the head branch is a branch on the origin repository. That branch points to a commit that should already have coverage information provided by the build that happens after merging a regular pull request. The thing is, coverage information provided by builds that happen before merging a pull request are associated with the commit of the head repository. This means that when merging up 1.2 into 1.3, the build produces coverage information that is the result of a merge between 1.2 and 1.3, and associates it with 1.2, although it is run on with a codebase that is much closer to 1.3 (and is in fact supposed to become 1.3 after the merge). This means that when we create a merge up PR from 1.2 to anything else, the coverage information is going to be wrong until a PR targeting 1.2 gets merged. I do not think we need coverage about conflictless merge up PRs more than we need accurate numbers, so I propose we disable the upload for those instead of, say, trying to associate them with the temporary merge commit.
1 parent 7c0eebe commit 38c6569

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ jobs:
363363
upload_coverage:
364364
name: "Upload coverage to Codecov"
365365
runs-on: "ubuntu-22.04"
366+
# Only run on PRs from forks
367+
if: "github.event.pull_request.head.repo.full_name != github.repository"
366368
needs:
367369
- "phpunit-smoke-check"
368370
- "phpunit-postgres"

0 commit comments

Comments
 (0)