This commit is contained in:
Colin McDonnell
2026-01-13 06:07:12 +00:00
parent a57866a8cd
commit 9714d5fea6
2 changed files with 16 additions and 13 deletions
+5 -5
View File
@@ -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 {
+11 -8
View File
@@ -15,11 +15,14 @@ async function main(): Promise<void> {
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<void> {
// 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<void> {
@@ -45,7 +48,7 @@ async function post(): Promise<void> {
}
await revokeInstallationToken(token);
core.info("installation token revoked successfully");
core.info("» installation token revoked");
}
async function run(): Promise<void> {