From ab2e52b938ea5da440d56de14141cb0f2878a57c Mon Sep 17 00:00:00 2001 From: Tobias Schranz Date: Sun, 9 Jun 2024 20:24:28 +0200 Subject: [PATCH] add release commit bash script --- release_commit.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 release_commit.sh diff --git a/release_commit.sh b/release_commit.sh new file mode 100755 index 0000000..71779b3 --- /dev/null +++ b/release_commit.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Error: No tag name provided." + echo "Usage: $0 " + exit 1 +fi + +TAG_NAME=$1 + +if [ -z "$(git status --porcelain)" ]; then + echo "Error: No changes to commit." + exit 1 +fi + +git add . +git commit -m "$TAG_NAME" + +git tag $TAG_NAME +git push --atomic origin main $TAG_NAME + +echo "Successfully tagged the current commit with '$TAG_NAME' and pushed to remote repository."