cleanup, add InstallationToken type

This commit is contained in:
ssalbdivad
2025-09-23 12:48:35 -04:00
parent f2a1c3c1bb
commit e13c5eed00
13 changed files with 127 additions and 144 deletions
+12 -1
View File
@@ -1,5 +1,15 @@
import * as core from "@actions/core";
export interface InstallationToken {
token: string;
expires_at: string;
installation_id: number;
repository: string;
ref: string;
runner_environment: string;
owner?: string;
}
/**
* Setup GitHub installation token for the action
*/
@@ -42,7 +52,8 @@ export async function setupGitHubInstallationToken(): Promise<string> {
);
}
const tokenData = await tokenResponse.json();
// This type is enforced by us when the response is created
const tokenData = (await tokenResponse.json()) as InstallationToken;
core.info(`Installation token obtained for ${tokenData.repository || "all repositories"}`);
// Mask the token in logs for security