From 0d6175d6ca7942fb888782443b3291b91dd7b0d0 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 27 Mar 2022 23:33:02 +0200 Subject: [PATCH] Improve tests workflow to send the coverage to Scrutinizer in the right conditions Copied from the sudo-bot/action-scrutinizer@latest action README Signed-off-by: William Desportes --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2702163406..432978fc33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,10 +103,10 @@ jobs: name: phpunit-${{ matrix.php-version }}-${{ matrix.os }} - name: Send coverage to Scrutinizer uses: sudo-bot/action-scrutinizer@latest - # Upload can fail on forks - continue-on-error: true + # Do not run this step on forked versions of the main repository (example: contributor forks) + if: github.repository == 'phpmyadmin/phpmyadmin' with: - cli-args: "--format=php-clover build/logs/clover.xml" + cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" - name: Send coverage to Codacy # Upload can fail on forks or if the secret is missing continue-on-error: true @@ -157,10 +157,10 @@ jobs: name: php-7.1-${{ matrix.extension }}-enabled - name: Send coverage to Scrutinizer uses: sudo-bot/action-scrutinizer@latest - # Upload can fail on forks - continue-on-error: true + # Do not run this step on forked versions of the main repository (example: contributor forks) + if: github.repository == 'phpmyadmin/phpmyadmin' with: - cli-args: "--format=php-clover build/logs/clover.xml" + cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" - name: Send coverage to Codacy # Upload can fail on forks or if the secret is missing continue-on-error: true