refactor(CommitMessageLinter): ensure workspace is a trusted git repository for commit linting
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
36ecc84249
commit
e33ac09e2a
@ -26,6 +26,8 @@ class CommitMessageLinter {
|
||||
steps.log.info "<Commit Message Linter> Linting commit messages from HEAD..."
|
||||
|
||||
steps.dir(steps.env.workspace) {
|
||||
// commit lint cli requires a git repository to lint commit messages, so we need make sure the workspace is a trusted git repository
|
||||
steps.sh "git config --global --add safe.directory ${steps.env.workspace}"
|
||||
steps.sh "commitlint --verbose -g ${rules} -f HEAD^"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user