github: use codecov token only for main push, no token for PRs

This commit is contained in:
Valentin Tolmer 2023-04-10 17:14:42 +02:00 committed by nitnelave
parent 825f37d360
commit 96f55ff28e
1 changed files with 7 additions and 0 deletions

View File

@ -101,6 +101,13 @@ jobs:
run: cargo llvm-cov --no-run --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: github.ref != 'refs/heads/main' || github.event_name != 'push'
with:
files: lcov.info
fail_ci_if_error: true
- name: Upload coverage to Codecov (main)
uses: codecov/codecov-action@v3
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
files: lcov.info
fail_ci_if_error: true