Skip to content

Commit 601902c

Browse files
authored
Merge pull request #10 from commitizen-tools/fix/docker-tag-retrieve
fix: use docker v2 api
2 parents 120c7ee + 539f232 commit 601902c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/publish-container.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install -U pip
29-
sudo apt-get install wget grep
29+
sudo apt-get install wget grep jq
3030
- name: Compare version from pip and docker and set version
3131
id: getversion
3232
run: |

scripts/auto_publish/compare-versions

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ pip_latest_version() {
88
python -m pip index versions commitizen | grep commitizen | grep -o -P '[0-9]+\.[0-9]+\.[0-9]+'
99
}
1010

11-
# requires wget, sed, gnu awk
11+
# requires curl & jq
1212
list_cz_docker_versions() {
13-
image=commitizen/commitizen
14-
wget -q "https://registry.hub.docker.com/v1/repositories/${image}/tags" -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
13+
curl -L -s 'https://registry.hub.docker.com/v2/repositories/commitizen/commitizen/tags/' | jq -r '.results[].name'
1514
}
1615

1716
PIP_LATEST=$(pip_latest_version)
18-
echo "latest pip version found '$PIP_LATEST'"
17+
printf "latest pip version found:\n%s\n\n" "$PIP_LATEST"
1918

2019
tags=$(list_cz_docker_versions)
20+
printf "Docker hub tags found:\n%s\n\n" "$tags"
2121

2222
if echo "${tags}" | grep -q "$PIP_LATEST"; then
2323
echo "Version already present, skipping other steps..."
@@ -28,4 +28,3 @@ else
2828
echo "Setting variable 'version'"
2929
echo "::set-output name=version::$PIP_LATEST"
3030
fi
31-

0 commit comments

Comments
 (0)