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

View File

@ -101,6 +101,13 @@ jobs:
run: cargo llvm-cov --no-run --lcov --output-path lcov.info run: cargo llvm-cov --no-run --lcov --output-path lcov.info
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v3 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: with:
files: lcov.info files: lcov.info
fail_ci_if_error: true fail_ci_if_error: true