Skip to content

fix(upstream-sync): multi-line prompt env var and MCP config token expansion#24

Merged
bashandbone merged 3 commits intomainfrom
copilot/fix-upstream-sync-yml
Mar 5, 2026
Merged

fix(upstream-sync): multi-line prompt env var and MCP config token expansion#24
bashandbone merged 3 commits intomainfrom
copilot/fix-upstream-sync-yml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 5, 2026

Two bugs in upstream-sync.yml caused the workflow to fail when attempting to read the agent prompt from a file.

Changes

  • $GITHUB_ENV multi-line valueecho "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\n being written literally instead of as actual newlines.

  • MCP config token expansion<< 'EOF' (single-quoted heredoc) suppresses variable expansion, so $GHTOKEN was written literally into the JSON auth header. Changed to << EOF so ${GHTOKEN} resolves to the actual PAT value.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…n expansion

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix upstream-sync.yml functionality for branch addition fix(upstream-sync): multi-line prompt env var and MCP config token expansion Mar 5, 2026
@bashandbone bashandbone marked this pull request as ready for review March 5, 2026 14:32
Copilot AI review requested due to automatic review settings March 5, 2026 14:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PROMPT to $GITHUB_ENV using 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 << EOF line. In GitHub Actions run: | blocks, YAML strips only the minimum indentation, so an extra couple leading spaces before EOF will prevent the heredoc from terminating (the shell will read until end-of-file). Align the closing EOF at the same indentation level as the cat > ... << EOF line (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>
@bashandbone bashandbone merged commit 4f85dbe into main Mar 5, 2026
33 of 34 checks passed
@bashandbone bashandbone deleted the copilot/fix-upstream-sync-yml branch March 5, 2026 15:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

👋 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:

I read the contributors license agreement and I agree to it.

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.
❌ @Copilot
@bashandbone
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Footnotes

  1. Our bot needs those exact words to recognize that you agree to the CLA.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants