From 4e41361ab63545b7615097090e27b9b7ebf37f56 Mon Sep 17 00:00:00 2001 From: Manish Baraskar Date: Wed, 26 Jun 2024 22:19:01 +0530 Subject: [PATCH] Removed multiline check for setting secret Issue #20049 in azure-pipelines-tasks which causes multiline secrets to fail the npm authenticate version 0.241.1 task --- node/task.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/node/task.ts b/node/task.ts index cfa22927a..19c53207d 100644 --- a/node/task.ts +++ b/node/task.ts @@ -214,10 +214,6 @@ export function setVariable(name: string, val: string, secret: boolean = false, let varValue = val || ''; debug('set ' + name + '=' + (secret && varValue ? '********' : varValue)); if (secret) { - if (varValue && varValue.match(/\r|\n/) && `${process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']}`.toUpperCase() != 'TRUE') { - throw new Error(loc('LIB_MultilineSecret')); - } - im._vault.storeSecret('SECRET_' + key, varValue); delete process.env[key]; } else { @@ -238,9 +234,6 @@ export function setVariable(name: string, val: string, secret: boolean = false, */ export function setSecret(val: string): void { if (val) { - if (val.match(/\r|\n/) && `${process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']}`.toUpperCase() !== 'TRUE') { - throw new Error(loc('LIB_MultilineSecret')); - } command('task.setsecret', {}, val); } }