From c427f3a8625d391c124ca3c7ab7d14fef10f96e4 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Thu, 16 Nov 2023 10:36:24 -0800 Subject: [PATCH] Jenkinsfile: Skip worker build for more cases We can skip the CI worker build if the changes are only from gitlint, or the hidden files in the root folder, such as .github, .gitignore, .gitlint, .rustfmt.toml, and .typos.toml. Signed-off-by: Bo Chen --- Jenkinsfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 45dff1d1e..5f14f5293 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -512,5 +512,19 @@ def boolean skipWorkerBuild() { return true } + if (sh( + returnStatus: true, + script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v '^\\.'" + ) != 0) { + return true + } + + if (sh( + returnStatus: true, + script: "git diff --name-only origin/${env.CHANGE_TARGET}... | grep -v 'gitlint'" + ) != 0) { + return true + } + return false }