(ci) Use Docker Hub OIDC for image publishing - #5107
Conversation
|
Docker Hub API blocker: the official GitVersion's |
d0c8a90 to
ba8ca45
Compare
|
There was a problem hiding this comment.
Pull request overview
This PR updates GitVersion’s CI Docker publishing pipeline to authenticate to Docker Hub using short-lived OIDC tokens (via docker/login-action), reducing reliance on long-lived Docker Hub credentials and limiting id-token: write to the jobs involved in image/manifest publishing.
Changes:
- Switch Docker image and manifest publishing to Docker Hub OIDC (
DOCKERHUB_OIDC_CONNECTIONID) and stop inheriting repository secrets for those reusable workflows. - Add
dockerhub_oidc_connection_idas an explicit reusable-workflow input and thread it through to the composite Docker publish/manifest actions. - Update Docker Hub logins in composite actions to use OIDC (and bump
docker/login-actionto v4.6.0).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/ci.yml | Grants id-token: write to Docker publishing jobs and passes the OIDC connection id via workflow inputs (removing secrets: inherit for Docker jobs). |
| .github/workflows/_docker.yml | Splits Docker workflow into test vs publish jobs so publishing can use OIDC + elevated permissions while tests remain minimal. |
| .github/workflows/_docker_manifests.yml | Updates manifest publishing workflow to use OIDC-based Docker Hub auth and scopes permissions to the publishing path. |
| .github/actions/docker-publish/action.yml | Replaces Docker Hub username/password login with OIDC-based login via DOCKERHUB_OIDC_CONNECTIONID. |
| .github/actions/docker-manifests/action.yml | Replaces Docker Hub username/password login with OIDC-based login via DOCKERHUB_OIDC_CONNECTIONID. |



Summary
docker/login-actionid-token: writeonly to publishing jobsConfiguration required
Before exercising the publishing path:
GitTools/GitVersiononrefs/heads/maingittools/gitversionDOCKERHUB_OIDC_CONNECTIONIDto that connection IDKnown limitation
Docker Hub README publishing intentionally still uses the existing credential action. The official
docker/oidc-actiondocumentation currently states that issued tokens are limited to registry login and that broader Docker Hub API authentication is not supported. The README publisher calls the Docker Hub API directly, so migrating that step now would make release publishing fail.This draft therefore covers the image and manifest portion of #5090, but does not close the issue.
Validation
actionlint .github/workflows/_docker.yml .github/workflows/_docker_manifests.yml .github/workflows/ci.ymlgit diff --checkCloses to #5090