🔄 synced file(s) with OpenIMSDK/Open-IM-Server
🤖 kubbot to synchronize the warehouse
This commit is contained in:
@@ -56,7 +56,8 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
|
||||
}
|
||||
|
||||
# TODO: go-gitlint dir set
|
||||
GITLINT_DIR="./_output/tools/go-gitlint"
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||
GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint"
|
||||
|
||||
$GITLINT_DIR \
|
||||
--msg-file=$1 \
|
||||
@@ -74,4 +75,18 @@ then
|
||||
printError "Please fix your commit message to match kubecub coding standards"
|
||||
printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Add Sign-off-by line to the end of the commit message
|
||||
# Get local git config
|
||||
NAME=$(git config user.name)
|
||||
EMAIL=$(git config user.email)
|
||||
|
||||
# Check if the commit message contains a sign-off line
|
||||
grep -qs "^Signed-off-by: " "$1"
|
||||
SIGNED_OFF_BY_EXISTS=$?
|
||||
|
||||
# Add "Signed-off-by" line if it doesn't exist
|
||||
if [ $SIGNED_OFF_BY_EXISTS -ne 0 ]; then
|
||||
echo -e "\nSigned-off-by: $NAME <$EMAIL>" >> "$1"
|
||||
fi
|
||||
Reference in New Issue
Block a user