From 987e4f5952c9dd2df6098380925f99edfedabf9a Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 16 May 2026 12:19:14 +0800 Subject: [PATCH] fix: use string concat for npm auth to avoid Jenkins sandbox GString.getBytes restriction --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef13bc9..a454bde 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) { script { - def auth = "${NPM_USER}:${NPM_PASS}".bytes.encodeBase64().toString() + def auth = (NPM_USER + ':' + NPM_PASS).bytes.encodeBase64().toString() writeFile file: '.npmrc', text: "@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/\n//nexus.xuqinmin.com/repository/npm-hosted/:_auth=${auth}\n" bat 'npm install --legacy-peer-deps' } @@ -68,7 +68,7 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) { script { - def auth = "${NPM_USER}:${NPM_PASS}".bytes.encodeBase64().toString() + def auth = (NPM_USER + ':' + NPM_PASS).bytes.encodeBase64().toString() writeFile file: '.npmrc', text: "@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/\n//nexus.xuqinmin.com/repository/npm-hosted/:_auth=${auth}\n" bat "npm publish --workspaces --registry %NEXUS_REGISTRY%" }