From 70b3b460837e9f6f02f662c93816e3a73a4a6886 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Tue, 18 Feb 2025 05:12:01 +0800 Subject: [PATCH] fix(semantic-release): add additional branch filter for rules Signed-off-by: zhenyus --- .../com/freeleaps/devops/SemanticReleasingExecutor.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index e0b9bf77..c2052b5e 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -25,16 +25,16 @@ class SemanticReleasingExecutor { steps.dir(steps.env.workroot) { steps.withCredentials([steps.usernamePassword(credentialsId: credentialsId, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { - steps.env.GIT_TOKENS = "${steps.env.GIT_PASSWORD}" + steps.log.warn("SemanticReleasingExecutor", "Setting up git credentials, execute workaround for semantic-release integrate with Azure DevOps") + // TODO: This should be supported by semantic-release itself, not a workaround here + steps.sh 'git config --global http.extraheader "AUTHORIZATION: Bearer ${steps.env.GIT_PASSWORD}"' steps.writeFile file: '.releaserc.json', text: steps.libraryResource(config) steps.log.info("SemanticReleasingExecutor", "Installing semantic-release requirements...") steps.sh "apt-get -y update && apt-get install -y --no-install-recommends git apt-transport-https ca-certificates curl wget gnupg" steps.log.info("SemanticReleasingExecutor", "Installing semantic-release plugins...") steps.sh "npm install -g ${plugins.join(' ')}" steps.sh "git config --global --add safe.directory ${steps.env.workroot}" - steps.sh "git branch --show-current" - steps.sh "ls -la ." - steps.sh "semantic-release --debug" + steps.sh "semantic-release --debug --no-ci" steps.log.info("SemanticReleasingExecutor", "Semantic release completed, read latest version from VERSION file") def released = steps.sh(script: 'test -f "VERSION"', returnStatus: true) == 0 if (released) {