Skip to content

Commit

Permalink
chore: Script to create a hot fix (#3502)
Browse files Browse the repository at this point in the history
* Hot fix

* Hot fix

* Update hot-fix.sh

* Update hot-fix.sh

* Update hot-fix.sh

* Update hot-fix.sh

* rename script

* Update create-cherry-pick-branch.sh
  • Loading branch information
brustolin committed Dec 28, 2023
1 parent 3297d6e commit 48e8c2e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/create-cherry-pick-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

#Creates a new branch from given tag and cherry pick commit.
#This helps to make a hotfix release by updating given version
#with the merge commit of a specific PR.

#run this from sentry-cocoa root directory

if [ "$#" -ne 3 ]; then
echo "Usage: $0 <current version> <new version> <commit hash>"
exit 1
fi

# Assign command-line arguments to variables
tag="$1"
version="$2"
commit_hash="$3"

# Define the hotfix branch name
hotfix_branch="hotfix/$version"

git checkout "tags/$tag"
git checkout -b "$hotfix_branch"
git cherry-pick "$commit_hash"
git push origin "$hotfix_branch"

echo "Hotfix branch $hotfix_branch created and pushed successfully."

0 comments on commit 48e8c2e

Please sign in to comment.