Skip to content

Comments

Fix YAML syntax error in news-generation workflow heredoc#97

Merged
pethers merged 3 commits intomainfrom
copilot/fix-yaml-syntax-error
Feb 11, 2026
Merged

Fix YAML syntax error in news-generation workflow heredoc#97
pethers merged 3 commits intomainfrom
copilot/fix-yaml-syntax-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

GitHub Actions workflow failed to parse due to heredoc content on line 173 being interpreted as YAML structure by the parser.

Changes

  • Replaced heredoc with echo command in timestamp update step
    • Heredoc cat <<EOF → single-line echo '...' > file
    • Eliminates parser ambiguity while maintaining identical JSON output

Technical Detail

YAML parsers attempt to interpret heredoc content between <<EOF and EOF when it resembles YAML structure (key-value pairs, indentation). The JSON object creation triggered this:

# Before: Parser confused by JSON structure
cat > news/metadata/last-generation.json <<EOF
{"timestamp": "${{ steps.check-updates.outputs.current_time }}", "generated": ${{ steps.generate.outputs.generated || 0 }}, "errors": ${{ steps.generate.outputs.errors || 0 }}}
EOF

# After: Single-line echo, no parser ambiguity
echo '{"timestamp": "${{ steps.check-updates.outputs.current_time }}", "generated": ${{ steps.generate.outputs.generated || 0 }}, "errors": ${{ steps.generate.outputs.errors || 0 }}}' > news/metadata/last-generation.json

Validated with yamllint -d relaxed - no syntax errors remain.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Replace problematic heredoc (cat <<EOF) with echo command to avoid
YAML parser confusion. The heredoc closing delimiter on line 173 was
causing "could not find expected ':'" syntax error.

Changes:
- Replace multi-line heredoc with single-line echo command
- Maintains same JSON output format
- Fixes YAML syntax validation

Validated with yamllint - no syntax errors remain.

Fixes #3

Co-authored-by: pethers <[email protected]>
Copilot AI changed the title [WIP] Fix yaml syntax error in news generation workflow Fix YAML syntax error in news-generation workflow heredoc Feb 11, 2026
Copilot AI requested a review from pethers February 11, 2026 16:05
@pethers pethers requested a review from Copilot February 11, 2026 16:15
@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers marked this pull request as ready for review February 11, 2026 17:14
@pethers pethers merged commit 3d169cb into main Feb 11, 2026
10 checks passed
@pethers pethers deleted the copilot/fix-yaml-syntax-error branch February 11, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants