From fed9160277961ca2eb86dc29771d474820cd3b7b Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 20 Aug 2024 14:40:38 +0200 Subject: [PATCH] fix ordering of repo2docker versions previous sorting didn't parse version suffixes correctly, so only the version part was sorted by number, the rest was sorted as strings so "2024.07.0-9.gafaa6e3" came after "2024.07.0-12.ga61ec54" instead, parse all number fields --- .github/workflows/watch-dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/watch-dependencies.yaml b/.github/workflows/watch-dependencies.yaml index 9f6de84f6..b5fc3781c 100644 --- a/.github/workflows/watch-dependencies.yaml +++ b/.github/workflows/watch-dependencies.yaml @@ -70,7 +70,7 @@ jobs: run: | latest_tag=$( docker run --rm quay.io/skopeo/stable list-tags docker://${{ matrix.registry }}/${{ matrix.repository }} \ - | jq -r '[.Tags[] | select(. | match("^\\d+\\.\\d+\\.\\d+(-\\d+\\..*)?$"))] | sort_by(split(".-") | map(tonumber? // 0)) | last' + | jq -r '[.Tags[] | select(. | match("^\\d+\\.\\d+\\.\\d+(-\\d+\\..*)?$"))] | max_by(scan("[^-.]+") | tonumber? // 0)' ) echo "tag=$latest_tag" >> $GITHUB_OUTPUT