Skip to content

Commit

Permalink
Submit coverage to codacy only if secret is available (patroni#1791)
Browse files Browse the repository at this point in the history
If PR is open from the external GH repo secrets are not set due to security reasons. It makes codacy coverage report to fail.
  • Loading branch information
CyberDem0n authored Dec 14, 2020
1 parent e3ef9ac commit a43baec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a43baec

Please sign in to comment.