Fix: Expansion of pr_body with breaking characters
Issue: #27
The expansion of the pr_body parameter from the INPUT_PR_BODY variable was not being properly escaped for use as an argument with hub. This caused " characters to end the command and the next character to be interpreted by bash, resulting in failures. This was also causing code blocks to disappear from the PR body.
The fix is the one suggested by @wei in https://github.com/repo-sync/pull-request/issues/27#issuecomment-650314540 . It uses the Q operator for expanding the INPUT_PR_BODY variable. Details on the expansion operator can be found here: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html.
this would not fix multiline body issues.
branch i used: https://github.com/dcflw/pull-request/commits/master
@math-breault do you have capacity to take a look?
Seems to be working with \n in #83 #103. Closing for now.
not fixed for us. using \n inside the string.
code we use to generate the string (via ruby)

pipeline code
- uses: ruby/setup-ruby@v1
name: Set up Ruby 2.7.5
with:
ruby-version: 2.7.5
- name: write message
run: |
ruby ./scripts/git_diff_message.rb
- name: Get message
id: vars
run: echo ::set-output name=pr_body::$(cat pr_msg)
- uses: repo-sync/pull-request@v2
name: pull-request
with:
source_branch: ${{ steps.branch.outputs.name }}
destination_branch: "master"
pr_title: "🚢 ${{ steps.branch.outputs.name }} - SHIP IT :shipit:"
pr_body: "
${{ steps.vars.outputs.pr_body }}"
github_token: ${{ secrets.GITHUB_TOKEN }}
so to me this is clearly not fixed.
@wei let's reopen this, unless i did something wrong :-)