diff --git a/get-installation-token/entry b/get-installation-token/entry index ada52f5..a8c13ed 100755 --- a/get-installation-token/entry +++ b/get-installation-token/entry @@ -25989,13 +25989,13 @@ var STATE_IS_POST = "isPost"; async function main() { core3.saveState(STATE_IS_POST, "true"); const reposInput = core3.getInput("repos"); - const repos = reposInput ? reposInput.split(",").map((r) => r.trim()).filter(Boolean) : void 0; - const token = await acquireInstallationToken({ repos }); + const additionalRepos = reposInput ? reposInput.split(",").map((r) => r.trim()).filter(Boolean) : []; + const token = await acquireInstallationToken({ repos: additionalRepos }); core3.setSecret(token); core3.saveState(STATE_TOKEN, token); core3.setOutput("token", token); - const scope = repos?.length ? `current repo + ${repos.join(", ")}` : "current repo only"; - core3.info(`installation token acquired successfully (${scope})`); + const scope = additionalRepos.length ? `current repo + ${additionalRepos.join(", ")}` : "current repo only"; + core3.info(`\xBB installation token acquired (${scope})`); } async function post() { const token = core3.getState(STATE_TOKEN); @@ -26004,7 +26004,7 @@ async function post() { return; } await revokeInstallationToken(token); - core3.info("installation token revoked successfully"); + core3.info("\xBB installation token revoked"); } async function run() { try { diff --git a/get-installation-token/entry.ts b/get-installation-token/entry.ts index b4c8bc6..6f2615a 100644 --- a/get-installation-token/entry.ts +++ b/get-installation-token/entry.ts @@ -15,11 +15,14 @@ async function main(): Promise { core.saveState(STATE_IS_POST, "true"); const reposInput = core.getInput("repos"); - const repos = reposInput - ? reposInput.split(",").map((r) => r.trim()).filter(Boolean) - : undefined; + const additionalRepos = reposInput + ? reposInput + .split(",") + .map((r) => r.trim()) + .filter(Boolean) + : []; - const token = await acquireInstallationToken({ repos }); + const token = await acquireInstallationToken({ repos: additionalRepos }); // mask the token in logs core.setSecret(token); @@ -30,10 +33,10 @@ async function main(): Promise { // set as output core.setOutput("token", token); - const scope = repos?.length - ? `current repo + ${repos.join(", ")}` + const scope = additionalRepos.length + ? `current repo + ${additionalRepos.join(", ")}` : "current repo only"; - core.info(`installation token acquired successfully (${scope})`); + core.info(`» installation token acquired (${scope})`); } async function post(): Promise { @@ -45,7 +48,7 @@ async function post(): Promise { } await revokeInstallationToken(token); - core.info("installation token revoked successfully"); + core.info("» installation token revoked"); } async function run(): Promise {