From ff55623d80ae5bc36ef99e596ddc745942d4693e Mon Sep 17 00:00:00 2001 From: nanxun Date: Fri, 21 Aug 2026 12:41:53 +0800 Subject: [PATCH] ci: skip cleanup before node allocation --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd96ab6..f42514f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -172,6 +172,15 @@ PY post { success { archiveArtifacts artifacts: 'artifacts/*.apk,artifacts/*.sha256,artifacts/*.json', fingerprint: true } - always { cleanWs(deleteDirs: true, notFailBuild: true) } + always { + script { + // A build can be aborted while still waiting for an executor. In that + // case Jenkins has no FilePath context and cleanWs would mask the + // original result with MissingContextVariableException. + if (env.NODE_NAME?.trim()) { + cleanWs(deleteDirs: true, notFailBuild: true) + } + } + } } }