From 950bf497cb7763e51fd4eff17d5da4096bf2d866 Mon Sep 17 00:00:00 2001 From: Maxime Daniel Date: Tue, 26 Sep 2023 16:05:42 +0200 Subject: [PATCH] zflist-publish: support tag and crosstag --- .github/workflows/zflist-publish | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/zflist-publish b/.github/workflows/zflist-publish index c4595ccf..835bdf40 100755 --- a/.github/workflows/zflist-publish +++ b/.github/workflows/zflist-publish @@ -98,3 +98,33 @@ if [ "$action" == "MERGE" ]; then zflist hub merge $filename $targetname fi +if [ "$action" == "CROSSTAG" ]; then + repository=$(echo $targetname | awk -F/ '{ print $1 }') + tagname=$(echo $targetname | awk -F/ '{ print $2 }') + + echo "Cross-tagging $filename -> $repository/tags/$tagname" + zflist hub crosstag $filename $repository $tagname +fi + +if [ "$action" == "TAG" ]; then + tagname=$(echo $filename | awk -F/ '{ print $1 }') + linkname=$(echo $filename | awk -F/ '{ print $2 }') + + repository=$(echo $targetname | awk -F/ '{ print $1 }') + target=$(echo $targetname | awk -F/ '{ print $2 }') + + echo "Tagging $repository/$target tag '$tagname' as '$linkname'" + zflist hub tag $tagname $linkname $repository $target +fi + +if [ "$action" == "UNTAG" ]; then + tagname=$(echo $filename | awk -F/ '{ print $1 }') + linkname=$(echo $filename | awk -F/ '{ print $2 }') + + repository=$(echo $targetname | awk -F/ '{ print $1 }') + target=$(echo $targetname | awk -F/ '{ print $2 }') + + echo "Untagging $repository/$target tag '$tagname' as '$linkname'" + zflist hub untag $tagname $linkname $repository $target +fi +