File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 26
26
- name : Install dependencies
27
27
run : |
28
28
python -m pip install -U pip
29
- sudo apt-get install wget grep
29
+ sudo apt-get install wget grep jq
30
30
- name : Compare version from pip and docker and set version
31
31
id : getversion
32
32
run : |
Original file line number Diff line number Diff line change @@ -8,16 +8,16 @@ pip_latest_version() {
8
8
python -m pip index versions commitizen | grep commitizen | grep -o -P ' [0-9]+\.[0-9]+\.[0-9]+'
9
9
}
10
10
11
- # requires wget, sed, gnu awk
11
+ # requires curl & jq
12
12
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'
15
14
}
16
15
17
16
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 "
19
18
20
19
tags=$( list_cz_docker_versions)
20
+ printf " Docker hub tags found:\n%s\n\n" " $tags "
21
21
22
22
if echo " ${tags} " | grep -q " $PIP_LATEST " ; then
23
23
echo " Version already present, skipping other steps..."
28
28
echo " Setting variable 'version'"
29
29
echo " ::set-output name=version::$PIP_LATEST "
30
30
fi
31
-
You can’t perform that action at this time.
0 commit comments