From 8691e4af92d88ca6782060c45a6de040cf7cf10e Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 27 Mar 2022 23:36:40 +0200 Subject: [PATCH] Improve Codacy coverage sending workflow Use the version that is on the README and only run on the main repo Signed-off-by: William Desportes --- .github/workflows/tests.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 432978fc33..f1f14d8a6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,9 +108,11 @@ jobs: with: cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" - name: Send coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + # Do not run this step on forked versions of the main repository (example: contributor forks) + if: github.repository == 'phpmyadmin/phpmyadmin' # Upload can fail on forks or if the secret is missing continue-on-error: true - uses: codacy/codacy-coverage-reporter-action@master with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: build/logs/clover.xml @@ -162,9 +164,11 @@ jobs: with: cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}" - name: Send coverage to Codacy + uses: codacy/codacy-coverage-reporter-action@v1 + # Do not run this step on forked versions of the main repository (example: contributor forks) + if: github.repository == 'phpmyadmin/phpmyadmin' # Upload can fail on forks or if the secret is missing continue-on-error: true - uses: codacy/codacy-coverage-reporter-action@master with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: build/logs/clover.xml