@@ -212,51 +212,10 @@ jobs:
212
212
213
213
current_semantic_version="${{github.ref_name}}"
214
214
215
- previous_semantic_version=""
216
- highest_version=""
217
-
218
- # Function to compare semantic versions
219
- compare_versions() {
220
- local version1="$1"
221
- local version2="$2"
222
- if [[ "$version1" == "$version2" ]]; then
223
- echo "equal"
224
- else
225
- if [[ "$version1" < "$version2" ]]; then
226
- echo "less"
227
- else
228
- echo "greater"
229
- fi
230
- fi
231
- }
232
-
233
215
# Sort the list of tags in ascending order
234
216
sorted_tags=($(printf "%s\n" "${semantic_version_tags[@]}" | sort -V))
235
217
236
- # Iterate through the sorted list of tags
237
- for tag in "${sorted_tags[@]}"; do
238
- echo $tag
239
-
240
- comparison_result=$(compare_versions "$tag" "$current_semantic_version")
241
-
242
- # If the current tag is less than or equal to the current semantic version and greater than the highest version found so far
243
- if [ "$comparison_result" != "greater" ] && [ "$comparison_result" != "equal" ] && [ "$comparison_result" == "less" ]; then
244
- highest_version="$tag"
245
- fi
246
-
247
- # If the current tag is equal to the current semantic version, set the previous version to the highest version found
248
- if [ "$comparison_result" == "equal" ]; then
249
- previous_semantic_version="$highest_version"
250
- fi
251
- done
252
-
253
- # Print the previous semantic version (if found)
254
- if [ -n "$previous_semantic_version" ]; then
255
- echo "Previous semantic version: $previous_semantic_version"
256
- else
257
- echo "No previous semantic version found."
258
- exit 1
259
- fi
218
+ previous_semantic_version=$sorted_tags[-1]
260
219
261
220
# Download & Install clog-tool/clog-cli
262
221
wget https://github.com/clog-tool/clog-cli/releases/download/v0.9.3/clog-v0.9.3-x86_64-unknown-linux-gnu.tar.gz
0 commit comments