From d568c0e88c74ab150cebd9a18afd3568567aec77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=8C=AF=E5=AE=87?= <> Date: Tue, 4 Feb 2025 11:19:52 +0800 Subject: [PATCH] refactor(CommitMessageLinter): correct safe.directory path to use environment variable for workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙振宇 <> --- .../src/com/freeleaps/devops/CommitMessageLinter.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy index 6df145e6..a8d80db1 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy @@ -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 ${WORKSPACE}/${steps.env.workspace}" + steps.sh "git config --global --add safe.directory ${steps.env.WORKSPACE}/${steps.env.workspace}" steps.sh "commitlint --verbose -g ${rules} -f HEAD^" } }