refactor(CommitMessageLinter): update safe.directory configuration to use absolute workspace path

Signed-off-by: 孙振宇 <>
This commit is contained in:
孙振宇 2025-02-04 11:18:05 +08:00
parent e33ac09e2a
commit 54f242e65b

View File

@ -27,7 +27,7 @@ class CommitMessageLinter {
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 "git config --global --add safe.directory ${WORKSPACE}/${steps.env.workspace}"
steps.sh "commitlint --verbose -g ${rules} -f HEAD^"
}
}