From 229ccc79e53079d975cd4f17df15defc4a7ff510 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 24 Jun 2024 10:44:09 -0500 Subject: [PATCH] Support empty CODECOV_TOKEN We'd still like to trigger this step if the CODECOV_TOKEN was specified but is empty, as would be the case if a PR is made from a fork. --- .github/workflows/pytest.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e5119ca..62aab02 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -48,6 +48,8 @@ jobs: needs: [setup] strategy: ${{ fromJson(needs.setup.outputs.strategy) }} runs-on: ${{ matrix.os }} + env: + HAVE_CODECOV_TOKEN: ${{ contains(toJson(secrets), 'CODECOV_TOKEN') }} steps: - uses: actions/checkout@v4 @@ -66,4 +68,4 @@ jobs: - uses: codecov/codecov-action@v4 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - if: ${{ env.CODECOV_TOKEN != '' }} + if: ${{ env.HAVE_CODECOV_TOKEN == 'true' }}