From 4551780d8c98a7c3b661a6e203dd602d8c36bdc1 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Fri, 13 Dec 2024 21:15:27 +0900 Subject: [PATCH 1/2] ci: backport to handle commit messages safely --- .github/workflows/backport.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 4b80dc4f3e..be803f5ce1 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -133,14 +133,16 @@ jobs: env: GH_TOKEN: ${{ github.token }} - id: commit_message + env: + COMMIT_MESSAGE: ${{ needs.backport-target-branch.outputs.commit_message }} run: | - commit_header=$(echo '${{ needs.backport-target-branch.outputs.commit_message }}' | head -n 1) + commit_header=$(echo "${COMMIT_MESSAGE}" | head -n 1) echo "commit_header=$commit_header" >> $GITHUB_OUTPUT - commit_body=$(echo '${{ needs.backport-target-branch.outputs.commit_message }}' | awk '/^$/{p++;next} p==1') + commit_body=$(echo "${COMMIT_MESSAGE}" | awk '/^$/{p++;next} p==1') echo "commit_body<> $GITHUB_OUTPUT echo "$commit_body" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - commit_footer=$(echo '${{ needs.backport-target-branch.outputs.commit_message }}' | awk '/^$/{p++;next} p==2') + commit_footer=$(echo "${COMMIT_MESSAGE}" | awk '/^$/{p++;next} p==2') echo "commit_footer<> $GITHUB_OUTPUT echo "$commit_footer" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT From eba3f62993401dbbcdbaafaf221d7310a5d88ea2 Mon Sep 17 00:00:00 2001 From: Sion Kang Date: Fri, 13 Dec 2024 21:15:41 +0900 Subject: [PATCH 2/2] fix typo --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index be803f5ce1..f97bb46017 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -146,7 +146,7 @@ jobs: echo "commit_footer<> $GITHUB_OUTPUT echo "$commit_footer" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Create Bakport PR + - name: Create Backport PR id: pr uses: peter-evans/create-pull-request@v6 with: