Skip to content

fix: enforce GITHUB_TOKEN for ghcr.io registry login#570

Merged
NilashishC merged 1 commit intomainfrom
fix/registry_login
Mar 31, 2026
Merged

fix: enforce GITHUB_TOKEN for ghcr.io registry login#570
NilashishC merged 1 commit intomainfrom
fix/registry_login

Conversation

@NilashishC
Copy link
Copy Markdown
Collaborator

Description

The || fallback in the container registry login step allowed REGISTRY_USERNAME/REGISTRY_PASSWORD secrets to override the default GITHUB_TOKEN credentials even when the target registry was ghcr.io. Replace the fallback with an explicit branch: ghcr.io always authenticates with github.actor + secrets.GITHUB_TOKEN; any other registry uses secrets.REGISTRY_USERNAME + secrets.REGISTRY_PASSWORD.

The current behavior is problematic if REGISTRY_* secrets are configured at an Org-level and the build in a repo has been invoked with ghcr.io as the target registry. Instead of using GITHUB_TOKEN, or github.actor, it will use REGISTRY_* to perform the login.

The `||` fallback in the container registry login step allowed
REGISTRY_USERNAME/REGISTRY_PASSWORD secrets to override the default
GITHUB_TOKEN credentials even when the target registry was ghcr.io.
Replace the fallback with an explicit branch: ghcr.io always
authenticates with github.actor + secrets.GITHUB_TOKEN; any other
registry uses secrets.REGISTRY_USERNAME + secrets.REGISTRY_PASSWORD.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Made-with: Cursor
@NilashishC NilashishC merged commit 55dc4fa into main Mar 31, 2026
20 checks passed
@shatakshiiii shatakshiiii deleted the fix/registry_login branch March 31, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants