Skip to content

Commit f2e44d4

Browse files
committed
TEST-1234 Commit message title
Clean commit message from GitHub pull request Commit message summary Remove unwanted characters from PR title
1 parent 091de7d commit f2e44d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

git-commit-push-script.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ commit_message=$(curl -s \
2727
| jq -r '.candidates[0].content.parts[0].text'
2828
)
2929

30+
echo $commit_message
31+
32+
# Clean up commit message - remove #, ```, and any other characters other than A-Z, a-z, 0-9, spaces, and new lines
33+
commit_message=$(echo "$commit_message" | sed 's/#//g' | sed 's/```//g' | sed 's/[^A-Za-z0-9 \n]//g')
34+
35+
echo $commit_message
36+
3037
# Prepare and execute commit command
3138
git commit -S -m "$ticket $commit_message"
3239

0 commit comments

Comments
 (0)