From 4a6edfcd1ea9a50b3ed244fe8fff4568ca055573 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 Jul 2026 14:19:36 +0300 Subject: [PATCH] CI: upload Scrutinizer coverage against the actual PR head commit On pull_request-triggered runs, actions/checkout checks out the ephemeral merge commit, not the PR branch's head commit. ocular.phar defaults --revision to `git rev-parse HEAD`, so coverage was being uploaded tagged to that merge commit's SHA. Scrutinizer's own inspection tracks the real PR head commit, never finds matching coverage for it, and the "Scrutinizer" check errors out waiting for data that was uploaded under the wrong revision. Pass --revision explicitly, preferring the PR head SHA over $GITHUB_SHA. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a028fdb..359df38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,10 +74,10 @@ jobs: if: "${{ matrix.php < '8.0' }}" run: | wget https://github.com/scrutinizer-ci/ocular/releases/download/1.6.0/ocular.phar - php ocular.phar code-coverage:upload --repository=g/aik099/CodingStandard --format=php-clover coverage.clover + php ocular.phar code-coverage:upload --repository=g/aik099/CodingStandard --revision="${{ github.event.pull_request.head.sha || github.sha }}" --format=php-clover coverage.clover - name: Upload Coverage to Scrutinizer CI (PHP >= 8.0) if: "${{ matrix.php >= '8.0' }}" run: | composer require scrutinizer/ocular - vendor/bin/ocular code-coverage:upload --repository=g/aik099/CodingStandard --format=php-clover coverage.clover + vendor/bin/ocular code-coverage:upload --repository=g/aik099/CodingStandard --revision="${{ github.event.pull_request.head.sha || github.sha }}" --format=php-clover coverage.clover