@@ -69,7 +69,16 @@ while IFS= read -r line; do
6969
7070 # Skip if new version matches pattern (case insensitive)
7171 if echo " $new_version " | grep -qiE " (-m[0-9]|-rc[0-9]|alpha|beta)" ; then
72- echo " Skipping preview version: $new_version ."
72+ echo -e " \u274C - Skipping preview version: $new_version ."
73+ echo " ---"
74+ continue
75+ fi
76+
77+ # Look up the mapping directly
78+ mapping=$( grep " ^${property_name} =" " $mapping_file " | cut -d ' =' -f2)
79+
80+ if [ -z " $mapping " ]; then
81+ echo -e " \u274C - No mapping found for property: $property_name . Skipping."
7382 echo " ---"
7483 continue
7584 fi
@@ -98,49 +107,40 @@ while IFS= read -r line; do
98107 fi
99108
100109 matches_found=$(( matches_found + 1 ))
110+
111+ creationResult=$( gh issue create \
112+ --title " Upgrade ${mapping} to ${new_version} " \
113+ --body " " \
114+ --label " in: infrastructure,type: dependency-upgrade" \
115+ --assignee " @me" \
116+ --milestone " ${targetVersion} " )
101117
102- # Look up the mapping directly
103- mapping=$( grep " ^${property_name} =" " $mapping_file " | cut -d ' =' -f2)
118+ # Create GitHub issue and capture the issue number
119+ issue_title=" Upgrade ${mapping} to ${new_version} "
120+ issue_number=$( echo $creationResult | grep -o ' [0-9]*$' )
104121
105- if [ -n " $mapping " ]; then
106-
107- creationResult=$( gh issue create \
108- --title " Upgrade ${mapping} to ${new_version} " \
109- --body " " \
110- --label " in: infrastructure,type: dependency-upgrade" \
111- --assignee " @me" \
112- --milestone " ${targetVersion} " )
113-
114- # Create GitHub issue and capture the issue number
115- issue_title=" Upgrade ${mapping} to ${new_version} "
116- issue_number=$( echo $creationResult | grep -o ' [0-9]*$' )
117-
118- echo " Created GitHub issue GH-${issue_number} - ${issue_title} ."
119-
120- # Update the version using Maven versions plugin
121- ./mvnw versions:set-property -q \
122- -DgenerateBackupPoms=false \
123- -Dproperty=${property_name} .version \
124- -DnewVersion=${new_version}
125-
126- echo " Updated ${property_name} .version from ${old_version} to ${new_version} ."
127-
128- # Commit the change with the issue number
129- git add pom.xml
130- git commit -m " GH-${issue_number} - Update ${mapping} to ${new_version} ."
131-
132- # Push changes to remote
133- git push
134-
135- # Close the issue
136- gh issue close ${issue_number}
137-
138- echo " Pushed changes and closed issue GH-${issue_number} "
139- echo " ---"
140- else
141- echo " No mapping found for property: $property_name . Skipping."
142- echo " ---"
143- fi
122+ echo " Created GitHub issue GH-${issue_number} - ${issue_title} ."
123+
124+ # Update the version using Maven versions plugin
125+ ./mvnw versions:set-property -q \
126+ -DgenerateBackupPoms=false \
127+ -Dproperty=${property_name} .version \
128+ -DnewVersion=${new_version}
129+
130+ echo " Updated ${property_name} .version from ${old_version} to ${new_version} ."
131+
132+ # Commit the change with the issue number
133+ git add pom.xml
134+ git commit -m " GH-${issue_number} - Update ${mapping} to ${new_version} ."
135+
136+ # Push changes to remote
137+ git push
138+
139+ # Close the issue
140+ gh issue close ${issue_number}
141+
142+ echo " Pushed changes and closed issue GH-${issue_number} "
143+ echo " ---"
144144 fi
145145done < " $mvn_output_file "
146146
0 commit comments