Skip to content

Commit ae3a7e4

Browse files
authored
Merge pull request #290 from maxmind/greg/eng-3512
Add branch validation checks to release script
2 parents 322bdff + 80fcf1f commit ae3a7e4

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
changelog=$(cat HISTORY.rst)
1424

1525
regex='

0 commit comments

Comments
 (0)