From c47808fc7b1cc5ec944d31340568b2ce50d2c071 Mon Sep 17 00:00:00 2001
From: Rory <rory.jennings@nexusmods.com>
Date: Thu, 20 Aug 2020 10:59:23 +0100
Subject: [PATCH] feat: add run-tag-pipeline option to release.sh

---
 src/release.sh | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/release.sh b/src/release.sh
index 15aa239..d20507b 100755
--- a/src/release.sh
+++ b/src/release.sh
@@ -10,4 +10,35 @@ cd "$CI_PROJECT_NAME"
 standard-version
 
 echo "Pushing new commit"
+
+# Check arguments for --run-tag-pipeline
+while :; do
+  case $1 in
+    -t|--run-tag-pipeline)
+      # Push the commit separately from the tag
+      git push -o ci.skip
+      # Grab the tag at this commit
+      TAG=$(git tag --points-at HEAD)
+      # Push the tag to origin
+      git push origin "$TAG"
+      exit
+      ;;
+    --)
+      # End of options
+      shift
+      break
+      ;;
+    -?*)
+      # Unrecognised option - ignore and continue
+      printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
+      ;;
+    *)
+      # Default case, flag not found, break out and continue with the default command
+      break
+  esac
+
+  shift
+done
+
+# No flag passed, follow-tags instead
 git push --follow-tags -o ci.skip
\ No newline at end of file
-- 
GitLab