Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gha/build: Use OIDC for Docker Hub login - #7131

#7131
Merged
vvoland merged 2 commits into
docker:masterdocker/cli:masterfrom
vvoland:build-oidcvvoland/cli:build-oidcCopy head branch name to clipboard
Jul 28, 2026
Merged

gha/build: Use OIDC for Docker Hub login#7131
vvoland merged 2 commits into
docker:masterdocker/cli:masterfrom
vvoland:build-oidcvvoland/cli:build-oidcCopy head branch name to clipboard

Conversation

@vvoland

@vvoland vvoland commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The switch from username/password secrets to OIDC for Docker Hub login is correctly implemented:

  • id-token: write permission is properly scoped at the job level
  • DOCKERHUB_OIDC_CONNECTIONID is correctly sourced from vars (not secrets) — OIDC connection IDs are non-secret identifiers, and this is the standard pattern for this action
  • The job-level if guard (github.repository == 'docker/cli' and github.event_name != 'pull_request') ensures this only runs in the canonical repo on non-PR events
  • username: dockereng with no password is the correct with: configuration for OIDC-based login in docker/login-action v4.4.0

@vvoland vvoland added this to the 29.7.0 milestone Jul 28, 2026
@vvoland
vvoland marked this pull request as ready for review July 28, 2026 13:00

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The OIDC migration looks correct:

  • id-token: write permission is properly scoped to the bin-image job
  • contents: read provides a sensible baseline
  • Hardcoded username: dockereng is the expected org account for Docker's OIDC login flow
  • DOCKERHUB_OIDC_CONNECTIONID is correctly passed via env as required by docker/login-action's OIDC path
  • Old username/password secrets are cleanly removed

No bugs introduced by this PR.

Comment thread .github/workflows/build.yml Outdated
name: Login to DockerHub
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nevermind, needs to update to v4.5.0+

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Done

OIDC login requires docker/login-action v4.5.0 or newer

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland
vvoland requested a review from crazy-max July 28, 2026 15:02

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

Lower-confidence findings (not posted inline)

  • [medium] .github/workflows/build.yml:114 — Hard-coded username dockereng and unverified DOCKERHUB_OIDC_CONNECTIONID repository variable may cause silent authentication failure (confidence: weak 38/100)

    In OIDC-based Docker Hub login, the static username: dockereng is likely the correct Docker Hub organization name (not a credential), so this is probably intentional. The main operational risk is that if vars.DOCKERHUB_OIDC_CONNECTIONID is not configured as a repository variable, the env value will be an empty string and authentication may silently misconfigure. This is a deployment prerequisite, not a code bug, but worth confirming the variable is set in repository settings.

uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
uses: docker/login-action@06fb636fac595d6fb4b28a5dfcb21a6f5091859c # v4.5.0
env:
DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] OIDC connection ID set via env: — verify docker/login-action v4.5.0 reads it from the environment

The new step passes DOCKERHUB_OIDC_CONNECTIONID as a step-level env: variable rather than as a with: input to the action. Whether this is correct depends on how docker/login-action v4.5.0 is implemented:

  • If the action reads the connection ID from process.env.DOCKERHUB_OIDC_CONNECTIONID (e.g. a dedicated env-var API), the current usage is correct.
  • If the action only reads it via core.getInput('oidc-connection-id') or a similar with: input, then the value will be ignored, and OIDC authentication will silently fall back or fail on push.

docker/login-action v4.5.0 appears to be a new release that introduced OIDC support; the expected API surface for the connection ID should be confirmed against its release notes / source. If the action expects a with: input (e.g. oidc-connection-id), the fix would be:

Suggested change
DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
env:
DOCKERHUB_OIDC_CONNECTIONID: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
with:
username: dockereng
oidc-connection-id: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
Confidence Score
🟠 weak 43/100

@vvoland
vvoland merged commit bd719d6 into docker:master Jul 28, 2026
99 checks passed
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.