diff --git a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy index 3c632cad..21176eb7 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy @@ -26,6 +26,8 @@ class CommitMessageLinter { steps.log.info " 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^" } }