@@ -14,18 +14,18 @@ update_pom_modules=()
1414for current_module_path in $all_module_paths ; do
1515 for changed_module_path in $changed_module_paths ; do
1616 if [[ " $changed_module_path " == " $current_module_path " * ]]; then
17- # echo $current_module_path" /pom.xml"
18- update_pom_modules+=($current_module_path )
17+ # echo " $current_module_path/pom.xml"
18+ update_pom_modules+=(" $current_module_path " )
1919 break
2020 fi
2121 done
2222done
2323
2424project_path=$( readlink -f " ." )
25- echo $project_path
25+ echo " $project_path "
2626root_version=" "
2727for module_path in " ${update_pom_modules[@]} " ; do
28- cd $module_path
28+ cd " $module_path " || exit
2929 artifact_id=$( mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
3030 version=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
3131 new_version=$( echo $version | awk -F' [.]' ' {printf "%d.%d.%d", $1, $2, $3+1}' )
@@ -35,19 +35,17 @@ for module_path in "${update_pom_modules[@]}"; do
3535 fi
3636 # -DprocessDependencies=false
3737 mvn versions:set -q -DnewVersion=$new_version -DartifactId=$artifact_id -DgenerateBackupPoms=false -DupdateMatchingVersions=false
38- cd $project_path
38+ cd " $project_path " || exit
3939done
4040
4141echo " Auto-increment version: $root_version "
4242
43- temp_name=" GitHub Actions Robot"
44- temp_email=" 1127664027@qq.com"
4543old_name=$( git config --local user.name)
4644old_email=$( git config --local user.email)
47- git config --local user.name " $temp_name "
48- git config --local user.email " $temp_email "
45+ git config --local user.name " GitHub Actions Robot "
46+ git config --local user.email " 1127664027@qq.com "
4947git status --porcelain | grep ' pom.xml$' | awk ' {print $2}' | xargs git add
50- git commit --author= " $temp_name < $temp_email > " - m " Auto-increment version: $root_version "
48+ git commit -m " Auto-increment version: $root_version "
5149git push
5250git config --local user.name " $old_name "
5351git config --local user.email " $old_email "
0 commit comments