From 30d502ac41b6d143347aec7d68912cdde6e4d405 Mon Sep 17 00:00:00 2001 From: Cherry Wang Date: Fri, 28 Jun 2024 11:07:54 +0800 Subject: [PATCH] fix: Set ENABLED_HTMLPROOFER=true only on PR validation Signed-off-by: Cherry Wang --- Jenkinsfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 243c067e7a..d719b8ba81 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,6 @@ pipeline { triggers { issueCommentTrigger('.*^recheck$.*') } - environment { - ENABLED_HTMLPROOFER = true - } stages { stage('Build Docs') { agent { @@ -23,11 +20,16 @@ pipeline { } } steps { - retry(4) { - sh 'mkdocs build' - sh 'sleep 5' // add a little delay to avoid potential rate limiting issues - } + script { + if ((env.BRANCH_NAME).startsWith('PR-')) { + env.ENABLED_HTMLPROOFER = true + } + retry(4) { + sh 'mkdocs build' + sh 'sleep 5' // add a little delay to avoid potential rate limiting issues + } + } // stash the site contents generated from mkdocs build stash name: 'site-contents', includes: 'docs/**', useDefaultExcludes: false }