diff --git a/.github/workflows/openim-ci.yml b/.github/workflows/openim-ci.yml index e063c6e3b..d58211444 100644 --- a/.github/workflows/openim-ci.yml +++ b/.github/workflows/openim-ci.yml @@ -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: diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg index bf00bfc31..99f4067b9 100644 --- a/scripts/githooks/commit-msg +++ b/scripts/githooks/commit-msg @@ -75,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 \ No newline at end of file