8000 chore: update workflow template (#3713) · googleapis/sdk-platform-java@cd89916 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd89916

Browse files
authored
chore: update workflow template (#3713)
In this PR: - Sync workflow template from googleapis/java-bigquerystorage#2913
1 parent f6bdade commit cd89916

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ set -e
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1)
19-
echo "${latest}"
18+
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
19+
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
20+
if [[ -z "${latest}" ]]; then
21+
echo "The latest version of ${group_id}:${artifact_id} is empty."
22+
echo "The returned json from maven.org is invalid: ${json_content}"
23+
exit 1
24+
else
25+
echo "${latest}"
26+
fi
2027
}
2128

2229
# Update a key to a new value in the generation config.

0 commit comments

Comments
 (0)
0