Skip to content

Fix heredoc delimiter to allow GitHub Actions expression evaluation in MCP configuration#1545

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-compiler-issue-lock-file
Oct 11, 2025
Merged

Fix heredoc delimiter to allow GitHub Actions expression evaluation in MCP configuration#1545
pelikhan merged 3 commits intomainfrom
copilot/fix-compiler-issue-lock-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 11, 2025

Problem

The compiler was generating invalid YAML lock files that caused workflow runs to fail with no jobs executed. The issue affected workflows using MCP server configurations, including the CLI version checker workflow (see failed run).

The root cause was using single-quoted heredoc delimiters (<< 'EOF') when writing MCP server configuration JSON. This prevented GitHub Actions expressions from being evaluated at runtime, resulting in invalid JSON being written to the configuration file.

Example of the invalid JSON generated:

{
  "env": {
    "GITHUB_AW_SAFE_OUTPUTS_CONFIG": ${{ toJSON(env.GITHUB_AW_SAFE_OUTPUTS_CONFIG) }},
  }
}

When the heredoc uses << 'EOF' (with quotes), the shell treats everything literally and doesn't allow GitHub Actions to evaluate ${{ toJSON(...) }} before writing the content. This creates syntactically invalid JSON at runtime.

Solution

Changed heredoc delimiters from << 'EOF' to << EOF (without quotes) to allow GitHub Actions expressions to be properly evaluated before the heredoc content is processed.

Files modified:

  • pkg/workflow/claude_engine.go - Claude MCP server configuration
  • pkg/workflow/copilot_engine.go - Copilot MCP server configuration
  • pkg/workflow/custom_engine.go - Custom engine MCP server configuration
  • Test files updated to expect the new delimiter format

Verification

  • All 64 workflows recompiled successfully with the fix
  • All unit and integration tests pass
  • Generated lock files now produce valid JSON at runtime
  • Code review completed with no issues

This fix ensures that GitHub Actions expressions in MCP server configurations are properly evaluated, generating valid JSON that can be parsed by the MCP servers at runtime.

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/repos/githubnext/gh-aw/actions/runs/18431451941
    • Triggering command: curl -s -L -H Accept: application/vnd.github&#43;json -H Authorization: Bearer -H X-GitHub-Api-Version: 2022-11-28 REDACTED (http block)
    • Triggering command: node /tmp/check_workflow.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Investigate and fix compiler issue that generated an invalid lock file for the cli version checker agentic workflow.

See failure in https://github.com/githubnext/gh-aw/actions/runs/18431451941


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Changed heredoc delimiter from << 'EOF' to << EOF (without quotes) in:
  - pkg/workflow/claude_engine.go: MCP servers configuration
  - pkg/workflow/copilot_engine.go: Copilot MCP configuration
  - pkg/workflow/custom_engine.go: Custom engine MCP configuration
- Updated tests to expect the new delimiter format
- Recompiled all 64 workflows successfully
- All unit and integration tests pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review October 11, 2025 16:01
@github-actions
Copy link
Copy Markdown
Contributor

Agentic Changeset Generator triggered by this pull request

Generated changeset documenting the fix for the compiler bug that was
generating invalid lock files due to incorrect heredoc delimiter usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI changed the title [WIP] Fix compiler issue generating invalid lock file for CLI Fix heredoc delimiter to allow GitHub Actions expression evaluation in MCP configuration Oct 11, 2025
Copilot AI requested a review from pelikhan October 11, 2025 16:05
@pelikhan pelikhan merged commit 1bf8fe5 into main Oct 11, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-compiler-issue-lock-file branch October 11, 2025 16:08
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