Skip to content

Commit

Permalink
add release commit bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
mesarth committed Jun 9, 2024
1 parent 8196ddf commit ab2e52b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions release_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Error: No tag name provided."
echo "Usage: $0 <tag-name>"
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."

0 comments on commit ab2e52b

Please sign in to comment.