Skip to content

Commit

Permalink
Set Codecov token using environment variable
Browse files Browse the repository at this point in the history
This is more direct than relying on option parsing in the Codecov CLI.

Unfortunately, Codecov has moved to required a token for uploading. In practice, this breaks coverage
uploads from PRs from forks since they do not have access to secrets.
  • Loading branch information
samdoran committed Apr 8, 2024
1 parent 67bb9f3 commit fa78f73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,12 @@ jobs:
- name: Upload coverage to Codecov
if: needs.changed-files.outputs.run_tests == 'true'
uses: codecov/codecov-action@v3.1.1
env:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
flags: unittests
name: Python-${{ matrix.python-version}}
# token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

- name: Set Codecov job status on skipped tests
Expand Down

0 comments on commit fa78f73

Please sign in to comment.