From d8d19fddd548749111520adef01dc47db10f71c6 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Tue, 18 Feb 2025 04:38:09 +0800 Subject: [PATCH] fix(semantic-release): add additional branch filter for rules Signed-off-by: zhenyus --- .../com/freeleaps/devops/SemanticReleasingExecutor.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy index fbacba5d..2c306ce2 100644 --- a/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy +++ b/first-class-pipeline/src/com/freeleaps/devops/SemanticReleasingExecutor.groovy @@ -1,5 +1,7 @@ package com.freeleaps.devops +import java.net.URLEncoder + class SemanticReleasingExecutor { def steps def workspace @@ -25,7 +27,9 @@ class SemanticReleasingExecutor { steps.dir(steps.env.workroot) { steps.withCredentials([steps.usernamePassword(credentialsId: credentialsId, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { - steps.env.GIT_CREDENTIALS = "${steps.env.GIT_USERNAME}:${steps.env.GIT_PASSWORD}" + def credentials = "${steps.env.GIT_USERNAME}:${steps.env.GIT_PASSWORD}" + def encodedCredentials = URLEncoder.encode(credentials, 'UTF-8') + steps.env.GIT_CREDENTIALS = encodedCredentials 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"