fix: alternative route of getting latest Gitea version

https://gitea.com/gitea/gitea-mirror no longer exists, instead use https://dl.gitea.com/gitea/version.json. Simplifies logic.
This commit is contained in:
Gusted 2025-03-21 19:02:26 +00:00
parent 9d001beba8
commit cd95e73756

View file

@ -147,8 +147,7 @@ function download_gitea() {
if ! test -f $DIR_BINARIES/gitea-$version; then
mkdir -p $DIR_BINARIES
if [[ $version =~ ^[0-9]+\.[0-9]+$ ]]; then
full_version=$(curl -sS "https://gitea.com/api/v1/repos/gitea/gitea-mirror/tags" | jq -r '.[] | .name | select(startswith("v'$version'"))' | grep -v -e '-rc' | sort --reverse --version-sort | head -1)
full_version=${full_version#v}
full_version=$(curl -sS "https://dl.gitea.com/gitea/version.json" | jq -r '.latest.version')
else
full_version=$version
fi