I'm in the process of creating an Azure Pipelines extension using Typescript and referring to Microsoft's documentation
During my development, I encountered an issue when trying to base64 encode a string using the btoa()
function which resulted in a pipeline failure -> ##[error]btoa is not defined
async function run() {
try {
const someString = "xxx"
//Encode Base64 someString
const sonarqubeTokenBase64 = btoa(`${someString}:`)
} catch (err) {
tl.setResult(tl.TaskResult.Failed, err.message);
}
}
Is there another way to encode a string in this extension?