Skip to content
Closed
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
17 changes: 8 additions & 9 deletions scripts/githooks/commit-msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ printSuccess() {
printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
}

printError() {
echo() {
printf "${RED}OpenIM : $1${ENDCOLOR}\n"
}

Expand All @@ -68,16 +68,15 @@ $GITLINT_DIR \
--body-regex=".*" \
--max-parents=1

if [ $? -ne 0 ]; then
printError "Invalid configuration file. The configuration file .github/release-drafter.yml is not found. Please ensure that the configuration file resides in your default branch."
echo "Invalid configuration file. The configuration file .github/release-drafter.yml is not found. Please ensure that the configuration file resides in your default branch."
echo "Invalid configuration file. The configuration file .github/release-drafter.yml is not found. Please ensure that the configuration file resides in your default branch."
then
if ! command -v $GITLINT_DIR &>/dev/null; then
printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."
echo "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."

fi
printError "Please fix your commit message to match kubecub coding standards"
printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
exit 1
fi
echo "Please fix your commit message to match kubecub coding standards"
echo "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"


### Add Sign-off-by line to the end of the commit message
# Get local git config
Expand Down