File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ commit_message=$(curl -s \
3434 | jq -r ' .candidates[0].content.parts[0].text'
3535 )
3636
37+ # If the commit message is empty, try again
38+ if [ -z " $commit_message " ]; then
39+ commit_message=$( curl -s \
40+ -H ' Content-Type: application/json' \
41+ -d " $gemini_request " \
42+ -X POST " https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent?key=${GEMINI_API_KEY} " \
43+ | jq -r ' .candidates[0].content.parts[0].text'
44+ )
45+ fi
46+
3747# Clean up commit message formatting - remove #, ```,
3848commit_message=$( echo $commit_message | sed ' s/#//g' | sed ' s/```//g' | sed ' s/Commit message title://g' | sed ' s/Commit message summary://g' )
3949
@@ -45,7 +55,11 @@ if [ -z "$commit_message" ]; then
4555fi
4656
4757# Prepare and execute commit command
48- git commit -S -m " $ticket $commit_message "
58+ if [ -z " $ticket " ]; then
59+ git commit -S -m " $commit_message "
60+ else
61+ git commit -S -m " $ticket $commit_message "
62+ fi
4963
5064# Check if the branch exists on the remote
5165remote_branch=$( git ls-remote --heads origin $base_branch )
You can’t perform that action at this time.
0 commit comments