Skip to content

Commit

Permalink
Merge pull request #14 from depot/mask
Browse files Browse the repository at this point in the history
Mask exported token value
  • Loading branch information
jacobwgillespie authored Jul 16, 2024
2 parents eb2efd6 + 07d78b3 commit b0b1ea4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2078,10 +2078,10 @@ var require_core = __commonJS({
command_1.issueCommand("set-env", { name }, convertedVal);
}
exports.exportVariable = exportVariable2;
function setSecret(secret) {
function setSecret2(secret) {
command_1.issueCommand("add-mask", {}, secret);
}
exports.setSecret = setSecret;
exports.setSecret = setSecret2;
function addPath2(inputPath) {
const filePath = process.env["GITHUB_PATH"] || "";
if (filePath) {
Expand Down Expand Up @@ -10942,6 +10942,7 @@ async function run() {
if (res.result && res.result.token) {
core.info(`Exchanged GitHub Actions OIDC token for temporary Depot token`);
core.exportVariable("DEPOT_TOKEN", res.result.token);
core.setSecret(res.result.token);
tokenFound = true;
}
} catch (err) {
Expand All @@ -10955,6 +10956,7 @@ async function run() {
const oidcToken = await publicOIDC.getIDToken("https://depot.dev");
core.info(`Using open-source pull request OIDC token for Depot authentication`);
core.exportVariable("DEPOT_TOKEN", oidcToken);
core.setSecret(oidcToken);
} catch (err) {
core.info(`Unable to exchange open-source pull request OIDC token for temporary Depot token: ${err}`);
}
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async function run() {
if (res.result && res.result.token) {
core.info(`Exchanged GitHub Actions OIDC token for temporary Depot token`)
core.exportVariable('DEPOT_TOKEN', res.result.token)
core.setSecret(res.result.token)
tokenFound = true
}
} catch (err) {
Expand All @@ -57,6 +58,7 @@ async function run() {
const oidcToken = await publicOIDC.getIDToken('https://depot.dev')
core.info(`Using open-source pull request OIDC token for Depot authentication`)
core.exportVariable('DEPOT_TOKEN', oidcToken)
core.setSecret(oidcToken)
} catch (err) {
core.info(`Unable to exchange open-source pull request OIDC token for temporary Depot token: ${err}`)
}
Expand Down

0 comments on commit b0b1ea4

Please sign in to comment.