From 5b81458412eb3322356e35e3b78fce6d208f57be Mon Sep 17 00:00:00 2001 From: Todd Leonhardt <2812720+tleonhardt@users.noreply.github.com> Date: Mon, 16 Nov 2026 11:46:32 -0500 Subject: [PATCH] Upload to Codecov with OIDC so Dependabot PRs can pass Dependabot-triggered workflow runs are not given GitHub Actions secrets, so CODECOV_TOKEN was empty and Codecov rejected the upload with "Token required because branch is protected". With fail_ci_if_error set, that failed every job in the test matrix on every Dependabot PR. Authenticate with a short-lived GitHub OIDC token instead, which needs no secret and is available to Dependabot runs. Fork PRs are unaffected: the action skips OIDC for forks and keeps using Codecov's tokenless upload. --- .github/workflows/tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffd2b8a76..3bc383d74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,11 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} + permissions: + contents: read + # Lets the Codecov steps authenticate with a short-lived OIDC token instead of the + # CODECOV_TOKEN secret, which Dependabot-triggered runs are not given. + id-token: write defaults: run: shell: bash @@ -48,7 +53,7 @@ jobs: flags: python${{ matrix.python-version }} name: codecov-umbrella-test-results report_type: test_results - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true - name: Upload coverage to Codecov uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: @@ -56,7 +61,7 @@ jobs: fail_ci_if_error: true flags: unittests name: codecov-umbrella - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true verbose: true # Single stable status check for the whole test matrix, so branch protection