Skip to content

Commit

Permalink
ci: fix cherry pick action when last commit message contains special …
Browse files Browse the repository at this point in the history
…characters (#2440)
  • Loading branch information
MohamadJaara authored Feb 1, 2024
1 parent 671bfb7 commit 209485c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/cherry-pick-rc-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jobs:
cd ..
git add ${{ env.SUBMODULE_NAME }}
git commit -m "Update submodule ${{ env.SUBMODULE_NAME }} to latest from ${{ env.TARGET_BRANCH }}"
echo "lastCommitMessage=$LAST_COMMIT_MESSAGE" >> $GITHUB_ENV
# Base64 encode the commit message to avoid issues with newlines and special characters
echo "lastCommitMessageBase64=$(echo "$LAST_COMMIT_MESSAGE" | base64)" >> $GITHUB_ENV
- name: Get Cherry-pick commit
id: get-cherry
Expand All @@ -102,7 +103,9 @@ jobs:
if [[ -n "${{ env.SUBMODULE_NAME }}" ]]; then
# If SUBMODULE_NAME is set
git reset --soft HEAD~2
git commit -m "${{ env.lastCommitMessage }}"
# Decode the base64-encoded string
LAST_COMMIT_MESSAGE=$(echo "${{ env.lastCommitMessageBase64 }}" | base64 --decode)
git commit -m "$LAST_COMMIT_MESSAGE"
fi
# Get the SHA of the current commit (either squashed or not based on the condition above)
Expand Down

0 comments on commit 209485c

Please sign in to comment.