From 8c0d53d46f81b3bbd61f53288a39ca7a975f51c2 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Sun, 3 Mar 2024 12:20:25 -0800 Subject: [PATCH] This logs the SHA256 of the issued token. Signed-off-by: Matt Moore --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index f98527e..1e5998f 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,11 @@ async function fetchWithRetry(url, options = {}, retries = 3, initialDelay = 100 if (!json2.token) { console.log(`::error::${json2.message}`); process.exit(1); } const tok = json2.token; + + const crypto = require('crypto'); + const tokHash = crypto.createHash('sha256').update(tok).digest('hex'); + console.log(`Token hash: ${tokHash}`); + console.log(`::add-mask::${tok}`); const fs = require('fs'); fs.appendFile(process.env.GITHUB_OUTPUT, `token=${tok}`, function (err) { if (err) throw err; }); // Write the output.