Skip to content

Commit 45cc376

Browse files
committed
Update release.yml
1 parent 126e4d5 commit 45cc376

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,18 @@ jobs:
8888
run: |
8989
git config --local user.email "action@github.com"
9090
git config --local user.name "GitHub Action"
91+
92+
# Get the default branch (usually main or master)
93+
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
94+
95+
# Checkout the default branch
96+
git fetch origin $DEFAULT_BRANCH
97+
git checkout -B $DEFAULT_BRANCH origin/$DEFAULT_BRANCH
98+
99+
# Now make your changes and commit them
91100
git add Formula/tctl.rb Formula/Versions/tctl@$VERSION.rb
92101
git commit -m "Update formulas for version $VERSION"
93-
git push
102+
git push origin $DEFAULT_BRANCH
94103
95104
- name: Create Release
96105
id: create_release

0 commit comments

Comments
 (0)