ci-demo-2/version-auto-update.sh

21 lines
386 B
Bash
Executable File

#!/usr/bin/env bash
read -r msg
if [[ $msg = *"BREAKING CHANGE:"* ]]; then
./update-version.sh MAJOR
fi
summary=$(echo "$msg" | head -1)
type=$(cut -d':' -f1 <<< "$summary")
if [[ $type = *"!"* ]]; then
./version-update.sh MAJOR
fi
if [[ $type = "feat" ]]; then
./version-update.sh MINOR
else
echo "last commit message does not indicate a base version update, skipping"
fi