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.
This commit is contained in:
Alexander Kukushkin
2020-12-14 15:49:37 +01:00
committed by GitHub
parent e3ef9ac306
commit a43baece68
+3 -1
View File
@@ -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