From fc303ff52019ea1edeaa55151c3aec4aed5dfe19 Mon Sep 17 00:00:00 2001 From: surps Date: Wed, 27 Aug 2025 02:42:54 +0530 Subject: [PATCH] Fix: Trim whitespace from file content before Base64 decoding --- credentials-migration/update-credentials-folder-level.groovy | 2 +- credentials-migration/update-credentials-system-level.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/credentials-migration/update-credentials-folder-level.groovy b/credentials-migration/update-credentials-folder-level.groovy index 0edcfd8..48b5907 100644 --- a/credentials-migration/update-credentials-folder-level.groovy +++ b/credentials-migration/update-credentials-folder-level.groovy @@ -21,7 +21,7 @@ import com.cloudbees.plugins.credentials.Credentials def encoded=[] // If you encounter the error "String too long. The given string is X Unicode code units long, but only a maximum of 65535 is allowed." when running this script, // save the encoded data to a file, such as /home/jenkins/folder_credentials.txt, omitting the starting [" and ending "], and un-comment the following line: -// encoded = [new File("/home/jenkins/folder_credentials.txt").text] +// encoded = [new File("/home/jenkins/folder_credentials.txt").text.trim()] if (!encoded) { return diff --git a/credentials-migration/update-credentials-system-level.groovy b/credentials-migration/update-credentials-system-level.groovy index 5f8d2f1..f451b69 100644 --- a/credentials-migration/update-credentials-system-level.groovy +++ b/credentials-migration/update-credentials-system-level.groovy @@ -13,7 +13,7 @@ import jenkins.model.Jenkins def encoded = [] // If you encounter the error "String too long. The given string is X Unicode code units long, but only a maximum of 65535 is allowed." when running this script, // save the encoded data to a file, such as /home/jenkins/system_credentials.txt, omitting the starting [" and ending "], and un-comment the following line: -// encoded = [new File("/home/jenkins/system_credentials.txt").text] +// encoded = [new File("/home/jenkins/system_credentials.txt").text.trim()] if (!encoded) { return }