Skip to content

Authenticate the Codecov upload with OIDC - #34

Merged
mpyw merged 1 commit into
mainfrom
codecov-oidc
Sep 22, 2026
Merged

mpyw merged 1 commit into
mainfrom
codecov-oidc

Conversation

@mpyw

@mpyw mpyw commented Sep 21, 2026

Copy link
Copy Markdown
Owner

secrets.CODECOV_TOKEN is replaced by an OIDC token the run mints for itself. The repository is public, so there is nothing the stored token protects that the run's own identity does not, and it is one less secret to hold and rotate.

Workflow id-token: write on the test job, use_oidc: true on the upload, and the stored token gone
Forks A pull request from a fork reaches neither the secret nor OIDC and uploads without either one, exactly as today

Verified on mpyw/go-skill-embed and mpyw/declscope first: the OIDC upload landed, and Codecov activated both repositories on its own.

Once this is green, CODECOV_TOKEN can be deleted from the repository secrets.

🤖 Generated with Claude Code

The upload carried a CODECOV_TOKEN secret. The repository is public, so
there is nothing that token protects that the run's own identity does
not, and it is one less secret to hold and rotate. The action mints a
GitHub OIDC token instead, which is what id-token: write on the job is
for.

A pull request from a fork reaches neither the secret nor OIDC, and
uploads without either one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.90%. Comparing base (3ddfef1) to head (1ba25f4).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #34   +/-   ##
=======================================
  Coverage   82.90%   82.90%           
=======================================
  Files          38       38           
  Lines        1685     1685           
=======================================
  Hits         1397     1397           
  Misses        288      288           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mpyw
mpyw merged commit 9ed1c32 into main Sep 22, 2026
8 checks passed
@mpyw
mpyw deleted the codecov-oidc branch September 22, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant