-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71a7692
commit e299cba
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
CURRENT_TAG="$1" | ||
TEMP_TAG="${CURRENT_TAG}-temp" | ||
GITHUB_BRANCH="${2}" | ||
|
||
echo "Going to push the tag changes." | ||
git config --global user.name 'PostHog Github Bot' | ||
git config --global user.email 'github-bot@posthog.com' | ||
git fetch | ||
git checkout ${GITHUB_BRANCH} | ||
# Create a new temporary tag after pushing the changes from the previous tag (bump version) | ||
git tag -a ${TEMP_TAG} -m "${TEMP_TAG}" | ||
# Remove the current tag | ||
git tag -d ${CURRENT_TAG} | ||
# Remove the current tag in remote machine | ||
git push --delete origin ${CURRENT_TAG} | ||
# Create a new tag that points to the temporary tag | ||
git tag ${CURRENT_TAG} ${TEMP_TAG} | ||
# Remove temporary tag | ||
git tag -d ${TEMP_TAG} | ||
# Propapate new tag to remote machine | ||
git push --tags |