Fix YAML syntax error in compile-agentic-workflows.yml#108
Conversation
Replace template literal with array.join() to avoid backtick conflicts. The JavaScript template literal containing markdown code blocks caused YAML parsing error on line 132. Now uses string concatenation instead. Fixes workflow compilation failure on copilot/update-index-html-language-support branch. Co-authored-by: pethers <[email protected]>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
Fixes a YAML parsing failure in the actions/github-script step by refactoring the issue body construction to avoid backtick/template-literal collisions when embedding Markdown code fences in YAML.
Changes:
- Replaced a JavaScript template literal with an array-of-lines joined by
\nfor the issue body. - Kept embedded Markdown code fences as plain strings to prevent YAML syntax errors.
| '# Compile all agentic workflows', | ||
| 'cd .github/workflows', | ||
| 'gh aw compile news-article-generator.md', | ||
| '', |
There was a problem hiding this comment.
The issue body says “Compile all agentic workflows”, but the command shown compiles only news-article-generator.md. Update the instructions to either loop over all .md files (matching what the workflow does) or change the heading/text to reflect that it’s a single-file compile command.
| const issue = await github.rest.issues.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| title: '⚠️ Agentic Workflow Lock Files Need Manual Compilation', | ||
| body: `## Problem | ||
|
|
||
| The agentic workflow markdown files have been updated, but the lock files could not be automatically compiled. | ||
|
|
||
| ### Action Required | ||
|
|
||
| Please compile the lock files locally: | ||
|
|
||
| \`\`\`bash | ||
| # Install gh-aw extension (first time only) | ||
| gh extension install github/gh-aw | ||
|
|
||
| # Compile all agentic workflows | ||
| cd .github/workflows | ||
| gh aw compile news-article-generator.md | ||
|
|
||
| # Commit and push the updated lock files | ||
| git add *.lock.yml | ||
| git commit -m "chore: recompile agentic workflow lock files" | ||
| git push | ||
| \`\`\` | ||
|
|
||
| ### Files Affected | ||
|
|
||
| - \`.github/workflows/news-article-generator.md\` | ||
| - \`.github/workflows/news-article-generator.lock.yml\` | ||
|
|
||
| ### Why This Happened | ||
|
|
||
| The gh-aw tool requires GitHub authentication and is not available in the automated workflow environment. | ||
|
|
||
| ### More Information | ||
|
|
||
| - [GitHub Agentic Workflows Documentation](https://github.com/github/gh-aw/blob/main/.github/aw/github-agentic-workflows.md) | ||
| - Triggered by: ${context.payload.head_commit?.message || 'Manual trigger'} | ||
| - Workflow run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId} | ||
| `, | ||
| body: issueBody, | ||
| labels: ['infrastructure', 'automated-issue', 'needs-action'] |
There was a problem hiding this comment.
This step calls github.rest.issues.create, but the workflow-level permissions: block does not grant issues: write. With the default GITHUB_TOKEN permissions, this will typically fail with 403 and the workflow won’t be able to open the manual-compilation issue. Add issues: write (and keep least-privilege for other scopes).
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
|
@copilot apply changes based on the comments in this thread can use env: |
YAML parser failed on line 132 due to backtick collision between JavaScript template literal and embedded markdown code fences in
github-scriptaction.Changes
Refactored issue body generation from template literal to array concatenation:
Before:
After:
Standard pattern for
github-scriptwhen markdown contains code blocks.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.