feat: add git hook sign

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/462/head
Xinwei Xiong(cubxxw-openim) 1 year ago
parent 667d9e33d7
commit ada9acf218

@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
go_version: [1.18, 1.19, 1.20]
go_version: ['1.18', '1.19', '1.20']
os: [ubuntu-latest, macOS-latest]
steps:

@ -76,3 +76,17 @@ then
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
Loading…
Cancel
Save