From af95ac03f4295c015b090824551af141d22db42b Mon Sep 17 00:00:00 2001 From: Coldwings Date: Mon, 4 Aug 2025 10:05:38 +0800 Subject: [PATCH] Fix AutoPR dealing with PR title/body contain quota like ` ' " --- .github/workflows/auto-pr-precise.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-pr-precise.yml b/.github/workflows/auto-pr-precise.yml index f590dcaf8..e8fdde6f6 100644 --- a/.github/workflows/auto-pr-precise.yml +++ b/.github/workflows/auto-pr-precise.yml @@ -62,6 +62,7 @@ jobs: echo "MESSAGE<<__EOF" >> $GITHUB_OUTPUT git log --format="> %B" ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT echo "__EOF" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT REVS=$(git rev-list --reverse ${{ github.event.commits[0].id }}~..${{ github.event.after }} ) for rev in "$REVS"; do if ! git cherry-pick ${rev} ; then @@ -74,14 +75,17 @@ jobs: - uses: actions/github-script@v7 name: Open pick PR to ${{steps.branch_info.outputs.NEXT_BRANCH}} + env: + TITLE: ${{steps.merge-changes.outputs.TITLE}} + MESSAGE: ${{steps.merge-changes.outputs.MESSAGE}} with: github-token: ${{ secrets.AUTOPR_SECRET }} script: | await github.rest.pulls.create({ ...context.repo, - title: `[Pick][${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ${{steps.merge-changes.outputs.TITLE}}`, + title: `[Pick][${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ` + process.env.TITLE, head: `${{steps.create_branch.outputs.PRBRANCH}}`, base: `${{steps.branch_info.outputs.NEXT_BRANCH}}`, - body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, by cherry-pick related commits`, + body: process.env.MESSAGE + `\nGenerated by Auto PR, by cherry-pick related commits`, });