From 682bbc5ef3c0ec411d10ac5e51cc71a69f12d573 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:22:48 +0800 Subject: [PATCH] refactor(CommitMessageLinter, SourceFetcher): update workspace path configuration for consistency 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 +- .../src/com/freeleaps/devops/SourceFetcher.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy b/first-class-pipeline/src/com/freeleaps/devops/CommitMessageLinter.groovy index a8d80db1..21176eb7 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 ${steps.env.WORKSPACE}/${steps.env.workspace}" + steps.sh "git config --global --add safe.directory ${steps.env.workspace}" steps.sh "commitlint --verbose -g ${rules} -f HEAD^" } } diff --git a/first-class-pipeline/src/com/freeleaps/devops/SourceFetcher.groovy b/first-class-pipeline/src/com/freeleaps/devops/SourceFetcher.groovy index 7f6495da..89a6bfec 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SourceFetcher.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SourceFetcher.groovy @@ -16,7 +16,7 @@ class SourceFetcher { steps.error("serviceGitBranch is required") } - steps.env.workspace = "workspace" + steps.env.workspace = "${steps.env.WORKSPACE}/devops-workspace/${configurations.serviceName}" steps.dir(steps.env.workspace) { steps.git branch: configurations.serviceGitBranch, credentialsId: 'git-bot-credentials', url: configurations.serviceGitRepo