Skip to content

ci: log in to Docker Hub through OIDC instead of stored credentials - #23

Merged
antas-marcin merged 1 commit into
mainfrom
docker-login-oidc
Dec 4, 2026
Merged

antas-marcin merged 1 commit into
mainfrom
docker-login-oidc

Conversation

@antas-marcin

@antas-marcin antas-marcin commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Switches Docker Hub login from the stored DOCKER_USERNAME/DOCKER_PASSWORD secrets to Docker Hub's organization OIDC connection, following weaviate/weaviate#14118.

Changes

  • Adds .github/actions/docker-login-oidc, the composite action from Use OIDC to pull from and push to Dockerhub weaviate#14118: docker/login-action v4.8.0 with OIDC, retried up to 3 times, since login-action retries the token exchange only on HTTP 429.
  • workflow-build.yaml: both jobs get id-token: write. The pre-build login uses the pull connection (DOCKERHUB_OIDC_PULL_CONNECTIONID). On tag builds, a separate login with the push connection (DOCKERHUB_OIDC_PUSH_CONNECTIONID) runs right before Deploy.
  • main.yaml / create-release.yaml: grant id-token: write to the called build workflow. A reusable workflow can't request more permissions than its caller grants.
  • cicd/docker_push*.sh: drop their own docker login and the credential env vars. They reuse the login done by the workflow.
  • Deploy steps now also skip PRs from forks, the same as the login steps.

Before merging

  • DOCKERHUB_OIDC_PULL_CONNECTIONID and DOCKERHUB_OIDC_PUSH_CONNECTIONID must be available to this repo, and the Docker Hub OIDC connections must trust it.
  • The push path runs only on tags, so this PR's CI checks only the pull login. The first release tag will be the first real test of the push login.
  • After a successful tagged release, the old DOCKER_USERNAME/DOCKER_PASSWORD secrets can be removed.

@antas-marcin
antas-marcin requested a review from a team as a code owner December 3, 2026 11:58

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@antas-marcin
antas-marcin merged commit 5f1b854 into main Dec 4, 2026
9 checks passed
@antas-marcin
antas-marcin deleted the docker-login-oidc branch December 4, 2026 10:31
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