ci: switch dockerhub login to OIDC - #6
Open
ingwarsw wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions Docker publishing flow to authenticate to Docker Hub via OIDC rather than long-lived DOCKER_HUB_USERNAME / DOCKER_HUB_PASSWORD secrets. This aligns the repo’s CI with the newer OIDC-based pattern used elsewhere.
Changes:
- Adds job-level permissions (
contents: read,id-token: write) to enable GitHub OIDC token minting for the Docker job. - Introduces
docker/oidc-actionto obtain a short-lived Docker Hub token and usesdocker/login-actionto log in with it. - Removes Docker Hub username/password inputs from
docker/build-push-action@v1, relying on the prior login step instead.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
DOCKER_HUB_USERNAME/DOCKER_HUB_PASSWORDsecrets in thedockerjob with thedocker/oidc-action+docker/login-actionOIDC flow, matching the pattern rolled out across other repos (see kentik/ksynth#14, kentik/kagent#1004).permissions: contents: read, id-token: writeto thedockerjob.docker/build-push-action@v1username/password inputs (which usedDOCKER_HUB_USERNAME/DOCKER_HUB_PASSWORD) with a separatedocker/oidc-action+docker/login-actionstep using thekentikOIDC connection, and dropped the username/password inputs from build-push-action.