Skip to content

Commit a7f2092

Browse files
authored
Merged to main
2 parents b9467ce + c957a8c commit a7f2092

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

git-commit-push-script.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ if [ -z "$COMMIT_MSG" ]; then
3232
exit 1
3333
fi
3434

35-
# Clean up commit message formatting - remove #, ```, period . at the end of response
36-
commit_message=$(echo $COMMIT_MSG | sed 's/#//g' | sed 's/```//g' | sed 's/Commit message title://g' | sed 's/Commit message summary://g' | sed 's/\.//g')
35+
# Clean up commit message formatting - remove #, ```, "", '', and period . at the end of response
36+
commit_message=$(echo $COMMIT_MSG | sed 's/#//g' | sed 's/```//g' | sed 's/Commit message title://g' | sed 's/Commit message summary://g' | sed 's/\.//g' | sed 's/\"//g' | sed "s/'//g")
3737

38-
# If the commit message is longer than 72 characters, truncate it
38+
# If the commit message is longer than 72 characters, truncate at the last word boundary
3939
if [ ${#commit_message} -gt 72 ]; then
40-
commit_message=${commit_message:0:72}...
40+
commit_message=$(echo $commit_message | cut -d' ' -f1-18)
4141
fi
4242

4343
# Echo the commit message
4444
echo $commit_message
4545

4646
# Set the GIT_SSH_PASSPHRASE environment variables
47-
export COMMIT_MESSAGE=$commit_message
47+
export COMMIT_MESSAGE="$commit_message"
4848
export TICKET="$ticket"
4949

5050
# Prepare and execute commit command, remove -S to commit without signing

0 commit comments

Comments
 (0)