Repository navigation
Configure the registry once and derive image names automatically - #4
Merged
Merged
Conversation
- Image name defaults to <registry>/<owner|project>/<repository> (GitHub owner/repo, Azure DevOps project/repo; repository only on Docker Hub). 'image' may also be a name below the registry. - Registry: 'registry' input > CONTAINER_REGISTRY variable > Azure service connection registry > ghcr.io on GitHub. - Organization/project wide credentials via CONTAINER_REGISTRY_USERNAME and CONTAINER_REGISTRY_PASSWORD (Azure secret variables included), only ever sent to the registry named in CONTAINER_REGISTRY. - Reusable GitHub workflow so a repository only needs 'uses: .../container-build.yml@v0' with 'secrets: inherit'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpAsQazVvi679PqLz7o1C1
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.
Summary
Neither GitHub nor Azure DevOps can store secrets for an action or extension at install time. This PR uses the closest supported alternative: the registry and its credentials live once in organization or project settings under well-known names, and every pipeline picks them up without extra inputs.
Automatic image names
When
imageis empty, the name is derived from the source:<registry>/<owner>/<repository><registry>/<project>/<repository>docker.io/<namespace>/<repository>(Docker Hub allows only one level)-.imagecan also be a short name below the registry (tools/api) or a full reference.registryinput,CONTAINER_REGISTRYvariable,ghcr.ioon GitHub.uses: onek8s/container-build-extension@v0alone pushes toghcr.io/<owner>/<repo>.Credentials configured once
CONTAINER_REGISTRY_USERNAME/CONTAINER_REGISTRY_PASSWORDare read from env and pipeline variables. On Azure this includes secret variables, which the agent passes to tasks asSECRET_*. They are removed from the environment once read.CONTAINER_REGISTRY. An image on another registry never receives them.variables: - group: container-registryplus- task: ContainerBuild@0, or use onlycontainerRegistry: <connection>..github/workflows/container-build.yml. With org variables and secrets in place, a repo needs onlyuses: onek8s/container-build-extension/.github/workflows/container-build.yml@v0andsecrets: inherit. Details:Testing
localhost:5001/e2e-project/demo_repo. Pushing to a different registry did not use the org credentials.Generated by Claude Code