Repository navigation
Conversation
The functions specs_tags, specs_labels and specs_annotations work out an image's metadata from the variables bake.yml's plan job will set, so a consumer's docker-bake.hcl describes what to build and this file decides how it is tagged. Local builds get the defaults: a :local tag and version dev. bake/test/run.sh runs docker buildx bake --print on an example HCL file for a set of events and compares the result with the expected JSON; lint.yml runs it on every push.
This was referenced Nov 9, 2026
…labels Images published with the 3.x workflows carry title, description and licenses labels that metadata-action took from the repository. To keep that key set, specs_labels now falls back to REPOSITORY_NAME and REPOSITORY_DESCRIPTION when the title or description passed in is empty, and always adds LICENSES. All three are empty locally, so a local build is unchanged. The utils test target passes an empty title and description, so the fixtures cover the fallback as well as an explicit value.
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.
Adds
bake/specs.hcl, the file consumers will vendor next to theirdocker-bake.hcl, withspecs_tags,specs_labelsandspecs_annotations(handoff Part 1, step 3, option C).1.2.3,1.2unless0.0.x,1unless0.x), pluslatest(or the bare variant) only whenIS_STABLE. A prerelease publishes only itself.pr-N, branch name (sanitized), schedulenightly, dispatch tag, and:localfor a local build.version,revision,source,url,created,licenses,title,description, the same keysmetadata-actiongave 3.x images. An empty title or description falls back to the repository's (REPOSITORY_NAME/REPOSITORY_DESCRIPTION), as in 3.x. Empty values are left out.bake/test/run.sh(task test) runsdocker buildx bake --printfor 12 cases (tagv1.2.3,-rc.1,v0.1.0,v0.0.5, non-semver, PR, branch, schedule, dispatch, local, unknown event) and diffs the result against the expected JSON.lint.ymlruns it.Part of the 4.0.0 stack (bake variant of the plan in #80). Merge bottom to top: #82 → #83 → #84 → #85 → #86.