fix(upstream-sync): multi-line prompt env var and MCP config token expansion#24
fix(upstream-sync): multi-line prompt env var and MCP config token expansion#24bashandbone merged 3 commits intomainfrom
Conversation
…n expansion Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes upstream-sync.yml so the upstream-sync workflow can (a) correctly export a multi-line agent prompt into $GITHUB_ENV, and (b) correctly expand the PAT token when generating the MCP config JSON used by the Claude action.
Changes:
- Writes
PROMPTto$GITHUB_ENVusing GitHub Actions’ multiline heredoc format (preserving real newlines). - Updates the MCP config heredoc to allow
${GHTOKEN}expansion and uses${GHTOKEN}in the Authorization header.
Comments suppressed due to low confidence (1)
.github/workflows/upstream-sync.yml:111
- The heredoc terminator for the MCP config appears to be indented relative to the
cat << EOFline. In GitHub Actionsrun: |blocks, YAML strips only the minimum indentation, so an extra couple leading spaces beforeEOFwill prevent the heredoc from terminating (the shell will read until end-of-file). Align the closingEOFat the same indentation level as thecat > ... << EOFline (or use a<<-EOF+ tab-indented terminator) so the delimiter is matched exactly.
}
}
}
}
EOF
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
|
👋 Hey @Copilot, Thanks for your contribution to codeweaver! 🧵You need to agree to the CLA first... 🖊️Before we can accept your contribution, you need to agree to our Contributor License Agreement (CLA). To agree to the CLA, please comment:
Those exact words are important1, so please don't change them. 😉 You can read the full CLA here: Contributor License Agreement ✅ @Copilot has signed the CLA. 0 out of 2 committers have signed the CLA. Footnotes
|
Two bugs in
upstream-sync.ymlcaused the workflow to fail when attempting to read the agent prompt from a file.Changes
$GITHUB_ENVmulti-line value —echo "PROMPT=$PROMPT" >> "$GITHUB_ENV"is invalid when the value contains newlines. Replaced with the required GitHub Actions heredoc format:{ echo 'PROMPT<<UPSTREAM_PROMPT_DELIMITER' printf 'REPO: %s\n\n' '${{ github.repository }}' cat '.github/_upstream_agent_prompt.md' echo 'UPSTREAM_PROMPT_DELIMITER' } >> "$GITHUB_ENV"Also fixes
\n\nbeing written literally instead of as actual newlines.MCP config token expansion —
<< 'EOF'(single-quoted heredoc) suppresses variable expansion, so$GHTOKENwas written literally into the JSON auth header. Changed to<< EOFso${GHTOKEN}resolves to the actual PAT value.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.