File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,14 @@ begin_test "ghe-host-check detects unsupported GitHub Enterprise Server versions
5656 read -r bu_version_major bu_version_minor _ <<< $( ghe_parse_version $BACKUP_UTILS_VERSION )
5757 bu_major_minor=" $bu_version_major .$bu_version_minor "
5858 releases=$( /usr/bin/curl -s https://github-enterprise.s3.amazonaws.com/release/latest.json)
59- supported=$( echo $releases | jq -r ' select(."' ${bu_major_minor} ' ")' )
59+ latest_value=$( echo " $releases " | jq -r ' .latest' )
60+ latest_major_version=$( echo $latest_value | cut -d " ." -f 1-2)
61+ # Replace "latest" with the derived major version in the releases string
62+ releases_with_replacement=$( echo " $releases " | sed ' s/"latest"/"' " $latest_major_version " ' "/g' )
63+ # Use the modified releases string as needed
64+ supported=$( echo " $releases_with_replacement " | jq -r ' select(."' ${bu_major_minor} ' ")' )
6065 # shellcheck disable=SC2207 # Command required as alternatives fail
61- keys=($( echo $releases | jq -r ' keys[]' ) )
66+ keys=($( echo " $releases_with_replacement " | jq -r ' keys[]' ) )
6267
6368 if [ -z " $supported " ]
6469 then
@@ -87,7 +92,6 @@ begin_test "ghe-host-check detects unsupported GitHub Enterprise Server versions
8792 GHE_TEST_REMOTE_VERSION=$bu_version_major .$bu_version_minor .999gm1 ghe-host-check
8893 ! GHE_TEST_REMOTE_VERSION=3.9999.1521793591.performancetest ghe-host-check
8994 GHE_TEST_REMOTE_VERSION=$(( bu_version_major+ 1 )) .0.0 ghe-host-check
90-
9195)
9296end_test
9397
You can’t perform that action at this time.
0 commit comments