Skip to content

Commit

Permalink
ci: backport to handle commit messages safely (#3247)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaminyam authored Dec 15, 2024
1 parent 16348f3 commit fc30408
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ 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<<EOF" >> $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<<EOF" >> $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:
Expand Down

0 comments on commit fc30408

Please sign in to comment.