forgejo: chose highest version when dealing with multiple downstream_versions
Some checks failed
/ lint (pull_request) Successful in 26s
/ deploy-aarch64 (pull_request) Failing after 2m4s
/ build-aarch64 (pull_request) Successful in 1m13s
/ deploy-x86_64 (pull_request) Has been cancelled
/ build-x86_64 (pull_request) Has been cancelled

This commit is contained in:
Antoine Martin 2024-10-29 08:52:42 -04:00
parent d07957ab63
commit eb8242c6f0
Signed by: ayakael
GPG key ID: D62A472A4AA7D541

View file

@ -15,7 +15,7 @@ rm -f out_of_date not_in_anitya
for pkg in $owned_by_you; do
upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Alpine" | jq -r '.items.[].stable_version')
downstream_version=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}')
downstream_version=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}' | sort -V | tail -n 1)
downstream_version=${downstream_version/-*}
# special case for forgejo-aneksajo: