Skip to content

Commit 9210e28

Browse files
committed
Add check to ensure that latest main is acquired
1 parent 92a0f49 commit 9210e28

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/release/scripts/prep-release.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ enforce_latest_code() {
2727
echo "Please stash your changes and try again."
2828
exit 1
2929
fi
30+
git fetch --quiet origin main
31+
if [[ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]]; then
32+
echo "ERROR: This script was not run from the latest code from origin/main."
33+
echo "Make sure to update your git branch with the latest from main and try again."
34+
exit 1
35+
fi
3036
}
3137

3238
# Function to validate the version number format x.y.z(-beta.w)
@@ -76,7 +82,7 @@ update_and_validate_build() {
7682
done
7783
}
7884

79-
# Ensure that the current working directory is clean
85+
# Ensure that the current working directory is clean and release is made of latest main
8086
enforce_latest_code
8187

8288
# Update and validate the version number

0 commit comments

Comments
 (0)