Skip to content

Commit

Permalink
Merge pull request #108 from ja573/main
Browse files Browse the repository at this point in the history
Use docker registry API v2
  • Loading branch information
clux authored Oct 7, 2022
2 parents 9128bdc + 4582286 commit 88a8a9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions check_stable.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ def rust_stable_version():

def tag_exists(tag):
"""Retrieve our built tags and check we have built a given one"""
url = f'https://registry.hub.docker.com/v1/repositories/{DOCKERHUB_REPO}/tags'
(namespace, repo) = DOCKERHUB_REPO.split("/")
url = f'https://registry.hub.docker.com/v2/namespaces/{namespace}/repositories/{repo}/tags'
req = urllib.urlopen(url)
data = json.loads(req.read())
req.close()
for x in data:
for x in data['results']:
if x['name'] == tag:
return True
return False
Expand Down

0 comments on commit 88a8a9d

Please sign in to comment.