Problem
The pr-build.yml workflow uses an intermediate instructions.md file to pass content between the "Generate installation instructions" step (run: step) and the "Comment on PR" step (actions/github-script). This is fragile because:
defaults.run.working-directory: cli makes run: steps write to cli/instructions.md
uses: steps (like actions/github-script) ignore defaults.run.working-directory and execute from repo root
- The path mismatch caused the PR comment step to fail with
ENOENT: no such file or directory
This same bug existed in azd-copilot (opposite direction) and was caught during PR #14 diagnosis.
Proposed Solution
Eliminate the instructions.md temp file entirely by inlining the instruction content generation in the actions/github-script step. The script already has access to all step outputs (steps.version.outputs.version, steps.pr.outputs.number, etc.) and can construct the markdown string directly in JavaScript.
This removes the fragile file handoff between steps and makes the workflow immune to working-directory mismatches.
Scope
- Refactor azd-rest pr-build.yml
- Apply same pattern to azd-copilot, azd-app, azd-exec for consistency
- Test by opening a PR and verifying the comment appears
Workaround
The immediate path fix (readFileSync('cli/instructions.md')) has been applied in the current codebase.
Problem
The
pr-build.ymlworkflow uses an intermediateinstructions.mdfile to pass content between the "Generate installation instructions" step (run:step) and the "Comment on PR" step (actions/github-script). This is fragile because:defaults.run.working-directory: climakesrun:steps write tocli/instructions.mduses:steps (likeactions/github-script) ignoredefaults.run.working-directoryand execute from repo rootENOENT: no such file or directoryThis same bug existed in azd-copilot (opposite direction) and was caught during PR #14 diagnosis.
Proposed Solution
Eliminate the
instructions.mdtemp file entirely by inlining the instruction content generation in theactions/github-scriptstep. The script already has access to all step outputs (steps.version.outputs.version,steps.pr.outputs.number, etc.) and can construct the markdown string directly in JavaScript.This removes the fragile file handoff between steps and makes the workflow immune to working-directory mismatches.
Scope
Workaround
The immediate path fix (
readFileSync('cli/instructions.md')) has been applied in the current codebase.