Skip to content

Commit

Permalink
chore(github): fix max version
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Jul 30, 2024
1 parent bc81a41 commit 2a59c57
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/scripts/prepare-matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import yaml
import requests

from subprocess import check_output

from os.path import isfile
from subprocess import check_output
from packaging.version import Version

repo_owner = os.environ.get('REPO_OWNER', os.environ.get('GITHUB_REPOSITORY_OWNER'))

Expand Down Expand Up @@ -63,8 +63,7 @@ def get_published_version(image_name):
tags = image["metadata"]["container"]["tags"]
if "rolling" in tags:
tags.remove("rolling")
# Assume the longest string is the complete version number
return max(tags, key=len)
return max(tags, key=lambda v: (Version(v), len(v)))

def get_image_metadata(subdir, meta, forRelease=False, force=False, channels=None):
imagesToBuild = {
Expand Down

0 comments on commit 2a59c57

Please sign in to comment.