Skip to content

Commit 1a668a7

Browse files
committed
Fix Bash syntax in the spring-cherry-pick.yml
1 parent 7d7aecd commit 1a668a7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/spring-cherry-pick.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ jobs:
3434
git config --global user.email '[email protected]'
3535
cherryPickToken='${{ inputs.autoCherryPickToken }}'
3636
commitMessage='${{ github.event.head_commit.message }}'
37-
branches=$(echo '$commitMessage' | grep '$cherryPickToken' | grep -o1 -E "([0-9]+\.[0-9]+\.x)")
38-
branchCommitMessage=$(echo '$commitMessage' | grep -v '$cherryPickToken')
37+
branches=$(echo "$commitMessage" | grep "$cherryPickToken" | grep -o1 -E "([0-9]+\.[0-9]+\.x)")
3938
for branch in $branches
4039
do
41-
git checkout $branch
42-
if git cherry-pick ${{ github.sha }}
40+
git checkout "$branch"
41+
if git cherry-pick ${{ github.sha }} -x
4342
then
44-
echo "::notice title=Commit cherry-picked::`${{ github.sha }}` to branch `$branch`"
43+
echo "::notice title=Commit cherry-picked::${{ github.sha }} to branch $branch"
4544
else
46-
echo "::error title=Cannot cherry-pick::`${{ github.sha }}` to branch `$branch`. Manual procedure required"
45+
echo "::error title=Cannot cherry-pick::${{ github.sha }} to branch $branch. Manual procedure required"
4746
exit 1
4847
fi
49-
git commit –amend -m "$branchCommitMessage"
48+
branchCommitMessage=$(git log -1 --pretty=%B | grep -v "$cherryPickToken")
49+
git commit --amend -o -m "$branchCommitMessage"
5050
git push $branch
5151
done

0 commit comments

Comments
 (0)