Skip to content

Commit 1d1ca5e

Browse files
committed
Add branch validation checks to release script
1 parent 65287df commit 1d1ca5e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dev-bin/release.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ if [ "$current_branch" = "main" ]; then
1010
exit 1
1111
fi
1212

13+
# Fetch latest changes and check that we're not behind origin/main
14+
echo "Fetching from origin..."
15+
git fetch origin
16+
17+
if ! git merge-base --is-ancestor origin/main HEAD; then
18+
echo "Error: Current branch is behind origin/main."
19+
echo "Please merge or rebase with origin/main before releasing."
20+
exit 1
21+
fi
22+
1323
phar='geoip2.phar'
1424

1525
changelog=$(cat CHANGELOG.md)

0 commit comments

Comments
 (0)