fix(ci): fix YAML parse error in components-independence workflow#310
fix(ci): fix YAML parse error in components-independence workflow#310
Conversation
The heredoc content inside the "Test external import" step's `run: |` block had Go code at column 0, which broke the YAML literal block scalar (content must be indented at least to the base level). Replace the heredoc with printf to keep all content properly indented. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes a GitHub Actions workflow YAML parse error in the components-independence CI workflow so it can run reliably on PRs that touch components/.
Changes:
- Replaces a heredoc that produced unindented lines (breaking YAML parsing) with a single
printfcommand to generatemain.goat the correct indentation level.
Code ReviewThis is a clean, focused fix that correctly addresses the YAML parsing issue in the components-independence workflow. What the fix doesReplacing the heredoc ( AssessmentCorrectness ✓ The fix is functionally equivalent. Single-quote safety ✓ The Go snippet contains no single quotes, so wrapping in Readability concern (minor)The one-liner is harder to read and maintain. If someone needs to change the Go snippet in the future (e.g., add an import), they have to carefully edit the printf '%s\n' \
'package main' \
'' \
'import (' \
$'\t"fmt"' \
$'\t"github.com/livetemplate/lvt/components"' \
')' \
'' \
'func main() {' \
$'\tfmt.Println(components.Version())' \
'}' \
> main.goThat said, for a CI test fixture this simple, the single-line form is acceptable — just a style trade-off. OverallThe root cause is correctly identified, the fix is minimal and accurate, and the PR description is clear. No functional or security concerns. Good to merge. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR ReviewSummaryThis PR fixes a real CI breakage: the heredoc inside a YAML
|
Summary
run: |), which broke GitHub's YAML parsercat <<'GOEOF'heredoc withprintfto keep all content at the proper YAML indentation levelRoot cause
YAML literal block scalars require all content lines to be indented at least as far as the first content line. The Go code inside the heredoc (e.g.,
package main) had zero indentation, terminating the block scalar early and causing a YAML parse error.Test plan
components-independenceworkflow runs correctly on a PR touchingcomponents/🤖 Generated with Claude Code