From a43baece68395a03be6f07cce9f7d29ccc189d83 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Mon, 14 Dec 2020 15:49:37 +0100 Subject: [PATCH] Submit coverage to codacy only if secret is available (#1791) If PR is open from the external GH repo secrets are not set due to security reasons. It makes codacy coverage report to fail. --- .github/workflows/tests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1595a214b..aaa19332b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -90,10 +90,12 @@ jobs: - name: Run codacy-coverage-reporter uses: codacy/codacy-coverage-reporter-action@master + env: + SECRETS_AVAILABLE: ${{ secrets.CODACY_PROJECT_TOKEN != '' }} with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: coverage.xml - if: matrix.os == 'ubuntu' + if: ${{ matrix.os == 'ubuntu' && env.SECRETS_AVAILABLE == 'true' }} behave: runs-on: ${{ matrix.os }}-latest