diff --git a/lib/main.js b/lib/main.js index 6301e863..e4fd29eb 100644 --- a/lib/main.js +++ b/lib/main.js @@ -192,7 +192,6 @@ function main() { } catch (error) { if (!isAzCLISuccess) { - core.error("CLI error:" + error); core.error("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows"); } else { @@ -214,15 +213,18 @@ function executeAzCliCommand(command, silent, execOptions = {}, args = []) { yield exec.exec(`"${azPath}" ${command}`, args, execOptions); } catch (error) { - throw new Error(error); + throw new Error("CLI error:" + error); } }); } function jwtParser(federatedToken) { return __awaiter(this, void 0, void 0, function* () { let tokenPayload = federatedToken.split('.')[1]; + console.log(tokenPayload); let bufferObj = Buffer.from(tokenPayload, "base64"); + console.log(bufferObj); let decodedPayload = JSON.stringify(bufferObj.toString("utf8")); + console.log(decodedPayload); return [decodedPayload["iss"], decodedPayload["sub"]]; }); } diff --git a/src/main.ts b/src/main.ts index a72a0317..66b38c57 100644 --- a/src/main.ts +++ b/src/main.ts @@ -185,7 +185,6 @@ async function main() { } catch (error) { if (!isAzCLISuccess) { - core.error("CLI error:" + error); core.error("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows"); } else { @@ -210,14 +209,17 @@ async function executeAzCliCommand( await exec.exec(`"${azPath}" ${command}`, args, execOptions); } catch (error) { - throw new Error(error); + throw new Error("CLI error:" + error); } } async function jwtParser(federatedToken) { let tokenPayload= federatedToken.split('.')[1]; + console.log(tokenPayload); let bufferObj = Buffer.from(tokenPayload, "base64"); + console.log(bufferObj); let decodedPayload = JSON.stringify(bufferObj.toString("utf8")); + console.log(decodedPayload); return [decodedPayload["iss"],decodedPayload["sub"]]; } main(); \ No newline at end of file