Skip to content

Commit

Permalink
PR: Split codecov action into with & without token
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Apr 27, 2023
1 parent be304d7 commit 55d0a9e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/code-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,29 @@ jobs:
- name: Generate full test coverage report using go-acc
run: make test:coverage

- name: Upload coverage to Codecov
- name: Upload coverage to Codecov without token
env:
codecov_secret: ${{ secrets.CODECOV_TOKEN }}
if: ${{ env.codecov_secret == '' }}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: ./coverage.txt
flags: defra-tests
name: codecov-umbrella
verbose: true

- name: Upload coverage to Codecov with token
env:
codecov_secret: ${{ secrets.CODECOV_TOKEN }}
if: ${{ env.codecov_secret != '' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage.txt
flags: defra-tests
name: codecov-umbrella
verbose: true
# path_to_write_report: ./coverage/codecov_report.txt
# directory: ./coverage/reports/

0 comments on commit 55d0a9e

Please sign in to comment.