Fix compiler escaping of literal ${{ in YAML heredocs#9280
Closed
Fix compiler escaping of literal ${{ in YAML heredocs#9280
Conversation
- Add escapeGitHubActionsExpressions() function to escape ${{ as $${{
- Update WritePromptTextToYAML to escape literal expressions
- Update WritePromptTextToYAMLWithPlaceholders to escape literal expressions
- Update compiler_yaml.go to escape expressions in prompt chunks
- Add comprehensive tests for expression escaping
- Recompile daily-secrets-analysis workflow with fix
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- daily-secrets-analysis: Escape literal ${{ in grep patterns
- cloclo: Escape ${{ in template conditionals
- plan: Escape ${{ in template conditionals
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix compiler for invalid workflow file
Fix compiler escaping of literal ${{ in YAML heredocs
Jan 7, 2026
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.
GitHub Actions YAML parser interprets
${{as expression start even inside quoted heredocs. Workflow markdown containing bash grep patterns likegrep '\${{ github\.event\.'caused compilation errors: "The expression is not closed."Changes
escapeGitHubActionsExpressions()inpkg/workflow/sh.go- replaces${{with$${{for YAML parserWritePromptTextToYAML(),WritePromptTextToYAMLWithPlaceholders(), andcompiler_yaml.gochunk writers now escape expressions before writing linesExample
Before (invalid YAML):
After (valid YAML):
GitHub Actions processes
$${{→${{in the bash script, preserving the intended grep pattern.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login xterm-color x_amd64/link(http block)/usr/bin/gh gh api user --jq .login runs/20260107-23/tmp/gh-aw-test-runs/20260107-230609-60282/test-orchestrator-2053235492/run-1008infocmp --jq /usr/bin/infocmp 13924/run-1008 GO111MODULE 64/pkg/tool/linu/repos/actions/github-script/git/ref/tags/v8 infocmp -1 /ref/tags/v8 64/pkg/tool/linuREDACTED 087802821/gh-aw 140/config.json GO111MODULE rtcfg.link 087802821/gh-aw(http block)/usr/bin/gh gh api user --jq .login /repos/actions/g/tmp/gh-aw-test-runs/20260107-230609-60282/test-orchestrator-4011807806/run-100 --jq /usr/bin/infocmp 5745ddd960829958f78a9f9841395b21b1d/log.json GO111MODULE 64/pkg/tool/linuuser infocmp -1 xterm-color eo/GFhb1wP7Cfs1Frev-parse le-integration-2526765884/gh-aw -json GO111MODULE erts/ca-certifi le-integration-2526765884/gh-aw(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.