From 0e7ec40e0812a987ce6f039872e7eb1cd618f7c9 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 11 Sep 2024 08:59:44 +0200 Subject: [PATCH] MAYBE ? | GH Actions: don't run code coverage on fork Forks cannot upload the coverage reports anyway as they don't have access to the token --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9d63ab64b..257b9852e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -162,7 +162,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: ${{ matrix.coverage && 'xdebug' || 'none' }} + coverage: ${{ matrix.coverage && github.repository == 'PHPMailer/PHPMailer' && 'xdebug' || 'none' }} ini-values: sendmail_path=/usr/sbin/sendmail -t -i, error_reporting=E_ALL, display_errors=On extensions: ${{ steps.set_extensions.outputs.EXT }} @@ -207,15 +207,15 @@ jobs: sudo cp test/fakesendmail.sh /usr/sbin/sendmail - name: Run tests, no code coverage - if: ${{ matrix.coverage == false }} + if: ${{ matrix.coverage == false || github.repository != 'PHPMailer/PHPMailer' }} run: ./vendor/bin/phpunit --no-coverage - name: Run tests with code coverage - if: ${{ matrix.coverage == true }} + if: ${{ matrix.coverage == true && github.repository == 'PHPMailer/PHPMailer' }} run: vendor/bin/phpunit - name: Send coverage report to Codecov - if: ${{ success() && matrix.coverage == true }} + if: ${{ success() && matrix.coverage == true && github.repository == 'PHPMailer/PHPMailer' }} uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}