Skip to content

Commit

Permalink
This logs the SHA256 of the issued token.
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Moore <[email protected]>
  • Loading branch information
mattmoor committed Mar 18, 2024
1 parent 60c0a50 commit 8c0d53d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8c0d53d

Please sign in to comment.