Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pre-check.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

branch=$(git rev-parse --abbrev-ref HEAD)

if [[ "${branch}" != "main" ]]; then
echo "This script can only be run on the main branch. Current branch is ${branch}"
if [[ "${branch}" != "main" && ! "${branch}" =~ ^release- ]]; then
echo "This script can only be run on the main or release-* branches. Current branch is ${branch}"
exit 1
fi

if ! git diff --quiet; then
echo "This script must only run on a clean main branch."
echo "This script must only run on a clean branch."
echo
git status
exit 1
Expand Down