fix(ci): unbreak pr-review-confirm workflow YAML parsing#27149
fix(ci): unbreak pr-review-confirm workflow YAML parsing#27149tylerbutler merged 2 commits intomicrosoft:mainfrom
Conversation
The Q&A step used bash heredocs whose bodies were flush-left inside a `run: |` YAML block scalar. YAML terminated the scalar at the first unindented line, so the workflow failed to parse and produced 0 jobs on every PR. Extract the prompt to .github/prompts/pr-review-qa.md (sibling to the reviewer prompts) and replace the heredocs with a python3 substitution that is safe for multi-line context and special characters in replies. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
|
Hey! You look nice today! Want me to review this PR? Based on the diff (51 lines, 2 files), I've queued these reviewers:
Toggle checkboxes to adjust, then reply yes to start — or ask me anything! |
There was a problem hiding this comment.
Pull request overview
Fixes the PR Review Confirm GitHub Actions workflow so it parses and runs correctly by moving the Q&A prompt into a dedicated prompt file and generating the final prompt safely at runtime.
Changes:
- Expand the workflow checkout sparse list to include
.github/prompts. - Replace the YAML-breaking heredoc construction with a Python-based placeholder substitution into a prompt template.
- Add a new
.github/prompts/pr-review-qa.mdtemplate for the Q&A prompt.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/pr-review-confirm.yml |
Updates checkout + replaces heredoc prompt assembly with template substitution. |
.github/prompts/pr-review-qa.md |
Adds the prompt template with __VAR__ placeholders for runtime substitution. |
| python3 -c ' | ||
| import os, sys | ||
| tmpl = open(sys.argv[1]).read() | ||
| tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"]) | ||
| tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"]) | ||
| sys.stdout.write(tmpl) | ||
| ' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md |
There was a problem hiding this comment.
The embedded Python passed to python3 -c is indented inside the single-quoted string. Those leading spaces become part of the Python source and will cause IndentationError: unexpected indent when this step runs. Please rewrite this so the -c code has no leading indentation (e.g., a single-line -c with semicolons, or generate/dedent the script content before execution). Also consider opening the template with an explicit encoding='utf-8' to avoid locale-dependent behavior on runners.
| python3 -c ' | |
| import os, sys | |
| tmpl = open(sys.argv[1]).read() | |
| tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"]) | |
| tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"]) | |
| sys.stdout.write(tmpl) | |
| ' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md | |
| python3 -c 'import os, sys; tmpl = open(sys.argv[1], encoding="utf-8").read(); tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"]); tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"]); sys.stdout.write(tmpl)' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md |
Per Copilot review on 36fe858: replace the inline python3 -c block in the workflow with a new render-qa-prompt subcommand on the existing pr_review_propose.py helper. This removes the YAML-block-indent / python interplay entirely, makes utf-8 encoding explicit, and lets us unit test the substitution (multi-line context, special characters, missing env vars, missing template). 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Description
The `PR Review Confirm` workflow (introduced in #27107) fails to parse and produces zero jobs on every PR — GitHub reports "This run likely failed because of a workflow file issue" (e.g. run 24861202057). The Q&A step used three bash heredocs whose bodies were flush-left inside a `run: |` YAML block scalar; YAML terminated the scalar at the first unindented line, leaving the rest of the file unparseable.
This change:
Reviewer Guidance
The review process is outlined on this wiki page.