From 96f55ff28eb9b22f266fafc9f59badd9560a93f1 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 10 Apr 2023 17:14:42 +0200 Subject: [PATCH] github: use codecov token only for main push, no token for PRs --- .github/workflows/rust.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4fab622..a2c5013 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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