Skip to content

Commit 14a10d8

Browse files
committed
fix(gitutils): šŸ› ensure develop branch is up-to-date before finishing release
1 parent a71f997 commit 14a10d8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

ā€Žsrc/gitutils/_git-release-prod.shā€Ž

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ if bump-changelog -f $GBV -b -m; then
8282
zz_log s "Version & CHANGELOG committed and pushed"
8383
fi
8484

85+
# Ensure develop branch is up-to-date before finishing release
86+
if ! git fetch origin develop:develop; then
87+
zz_log e "Cannot fetch develop branch from remote"
88+
exit 1
89+
fi
90+
91+
if ! git merge-base --is-ancestor $(git rev-parse develop) $(git rev-parse origin/develop) ; then
92+
zz_log e "Develop branch is not up-to-date with remote. Please pull the latest changes."
93+
exit 1
94+
fi
95+
8596
if git flow $flow finish $name --push --tagname $GBV --message $GBV ; then
8697
zz_log s "Release finished: {B $GBV}"
8798
rm -f .git/RELEASE

0 commit comments

Comments
Ā (0)