Skip to content

Fix YAML compilation error in multiline run blocks#7451

Merged
pelikhan merged 4 commits intomainfrom
copilot/fix-workflow-compilation-error
Dec 23, 2025
Merged

Fix YAML compilation error in multiline run blocks#7451
pelikhan merged 4 commits intomainfrom
copilot/fix-workflow-compilation-error

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

The workflow compiler generated invalid YAML when creating prompt steps. The run: key was written as a single-line value, but subsequent heredoc content at the same indentation level was parsed as new mapping keys, causing go-yaml validation to fail with "value is not allowed in this context."

Changes

  • pkg/workflow/compiler_yaml.go: Use YAML multiline literal format (run: |) for prompt creation steps
    • Changed line 211 from run: bash ... to run: | with bash command on next indented line
    • Ensures heredoc content is properly parsed as part of the run block value

Before

run: bash /tmp/gh-aw/actions/create_prompt_first.sh
  cat << 'PROMPT_EOF' > "$GH_AW_PROMPT"
  # Content here...
  PROMPT_EOF

After

run: |
  bash /tmp/gh-aw/actions/create_prompt_first.sh
  cat << 'PROMPT_EOF' > "$GH_AW_PROMPT"
  # Content here...
  PROMPT_EOF

All 123 workflow lock files regenerated with corrected YAML syntax.

Original prompt

Fix the compilation of workflows. it generates invalid yaml.

@pelikhan ➜ /workspaces/gh-aw (main) $ ./gh-aw compile smoke-copilot
✓ .github/workflows/smoke-copilot.md (317.2 KB)
generated lock file is not valid YAML: [2104:11] value is not allowed in this context. map key-value is pre-defined
2102 | # Smoke Test: Copilot Engine Validation
2103 |

2104 | IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.
^
2106 | ## Test Requirements
2107 |
✗ Compiled 1 workflow(s): 1 error(s), 0 warning(s)
✗ Failed workflows:

  • /workspaces/gh-aw/.github/workflows/smoke-copilot.md (1 error)
    ✗ generated lock file is not valid YAML: [2104:11] value is not allowed in this context. map key-value is pre-defined
    2102 | # Smoke Test: Copilot Engine Validation
    2103 |

2104 | IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.
^
2106 | ## Test Requirements
2107 |


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

Copilot AI and others added 3 commits December 23, 2025 23:12
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow compilation to generate valid YAML Fix YAML compilation error in multiline run blocks Dec 23, 2025
Copilot AI requested a review from pelikhan December 23, 2025 23:24
@pelikhan pelikhan marked this pull request as ready for review December 23, 2025 23:30
@pelikhan pelikhan merged commit d9c915f into main Dec 23, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-workflow-compilation-error branch December 23, 2025 23:31
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