From c3a1d11d015ebae8b652a3c3c4bf3443cd902458 Mon Sep 17 00:00:00 2001 From: jnywong Date: Wed, 14 Feb 2024 16:29:24 +0000 Subject: [PATCH] Fix helper script --- helper.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helper.sh b/helper.sh index 9e2d21e3..3a2ec137 100755 --- a/helper.sh +++ b/helper.sh @@ -2,4 +2,5 @@ # Helper shell script to update exercise in episodes/manage_images.md with the latest handbook-authoring-image tag. FILE=${PWD}"/episodes/manage_images.md" -sed -i 's/LATEST/'$1'/g' $FILE +TAG=`curl -s -H "Authorization: Bearer "$1"" -X GET "https://quay.io/api/v1/repository/2i2c/handbook-authoring-image/tag/" | grep -Eo '"name": *"[^"]*"' | head -1 | awk '{ print $2 }' | tr -d \"` +sed -i 's/LATEST/'${TAG}'/g' ${FILE}