fix(ci): strip inline comments from docker metadata tags block#453
Merged
Conversation
The `tags:` input to docker/metadata-action uses a YAML literal block scalar (`|`), where `#` is not a YAML comment but literal text. The trailing "# e.g., ..." comments were being sent to the action verbatim, corrupting the `enable`/`value` attributes on each line. This caused a hard failure after the metadata-action v5->v6 bump (which made enable-attribute validation stricter): Invalid value for enable attribute: true # Always tag latest on main branch release Move the explanations to real comment lines above the block instead.
There was a problem hiding this comment.
Pull request overview
Fixes the Release workflow’s Docker publish job failure by ensuring the docker/metadata-action tags: YAML literal block contains only tag directives (no inline # ... text that would be passed through and break parsing), moving the explanatory notes to proper YAML comment lines above the block.
Changes:
- Removed inline
# ...suffixes from eachtags:entry sodocker/metadata-action@v6receives clean tag directives. - Added an explicit warning comment explaining why inline
#text must not appear inside thetags: |literal block, plus example tag formats.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with: | ||
| images: ghcr.io/${{ github.repository }} | ||
| # Use the version from the semantic-release output | ||
| # Use the version from the semantic-release output. |
| # type=semver,pattern={{version}} e.g. 2.4.3 | ||
| # type=semver,pattern=v{{major}}.{{minor}} e.g. v2.4 | ||
| # type=semver,pattern=v{{major}} e.g. v2 | ||
| # type=raw,value=latest,enable=true always tag latest on main branch release |
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
tags:input todocker/metadata-actionuses a YAML literal block scalar (|), where#is not a YAML comment but literal text. The trailing# e.g., ...comments on each tag line were being sent to the action verbatim, corrupting theenable/valueattributes it parses (e.g.enable=true # Always tag latest on main branch releasefails strict boolean parsing).docker/metadata-action@v5 -> v6bump (7087ebb), which validates theenableattribute more strictly.Side effect to be aware of
Because the job failed before the push step ran, the
v2.4.3Docker image was never published to GHCR —ghcr.io/arabold/docs-mcp-server:lateststill points at2.4.2. This PR only fixes the workflow going forward; publishing the missing2.4.3image is a separate follow-up.Test plan
js-yaml)