From 57393ea18e668881978d18e0166261571c39023a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 5 Nov 2026 10:53:58 +0100 Subject: [PATCH] ci: use OIDC authentication for Codecov uploads (remaining workflows) follow-up to 18958e4c02874a5c9eddece3afb448ea774fc5ec, which updated the e2e workflow, but forgot to update the other workflows. Replace the CODECOV_TOKEN secret with GitHub Actions OIDC authentication. Codecov supports tokenless uploads for public repositories, but authenticated uploads are still needed to protect coverage results on protected branches from unauthorized uploads. Grant `id-token: write` at the job level to allow Codecov to request a short-lived OIDC token. This permission does not grant repository write access, and scoping it to the job avoids granting it to other jobs added to the workflow in the future. Coverage uploads from forked pull requests continue to use Codecov's tokenless upload mechanism. See https://github.com/codecov/codecov-action/blob/v7.1.1/README.md#using-oidc Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dfe9f8c0d1..46f4f5e138 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,9 @@ on: jobs: ctn: + permissions: + contents: read + id-token: write # needed for CodeCov; https://github.com/codecov/codecov-action/blob/v7.1.1/README.md#using-oidc runs-on: ubuntu-26.04 steps: - @@ -41,9 +44,12 @@ jobs: uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: files: ./build/coverage/coverage.txt - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true host: + permissions: + contents: read + id-token: write # needed for CodeCov; https://github.com/codecov/codecov-action/blob/v7.1.1/README.md#using-oidc runs-on: ${{ matrix.os }} env: GOPATH: ${{ github.workspace }} @@ -86,4 +92,4 @@ jobs: with: files: /tmp/coverage.txt working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true