cleanup comments
This commit is contained in:
@@ -14,13 +14,11 @@ export interface InstallationToken {
|
||||
* Setup GitHub installation token for the action
|
||||
*/
|
||||
export async function setupGitHubInstallationToken(): Promise<string> {
|
||||
// Check if we have an installation token from inputs or environment
|
||||
const inputToken = core.getInput("github_installation_token");
|
||||
const envToken = process.env.GITHUB_INSTALLATION_TOKEN;
|
||||
|
||||
const existingToken = inputToken || envToken;
|
||||
if (existingToken) {
|
||||
// Mask the existing token in logs for security
|
||||
core.setSecret(existingToken);
|
||||
core.info("Using provided GitHub installation token");
|
||||
return existingToken;
|
||||
@@ -29,11 +27,9 @@ export async function setupGitHubInstallationToken(): Promise<string> {
|
||||
core.info("Generating OIDC token...");
|
||||
|
||||
try {
|
||||
// Generate OIDC token for our API
|
||||
const oidcToken = await core.getIDToken("pullfrog-api");
|
||||
core.info("OIDC token generated successfully");
|
||||
|
||||
// Exchange OIDC token for installation token
|
||||
const apiUrl = process.env.API_URL || "https://pullfrog.ai";
|
||||
|
||||
core.info("Exchanging OIDC token for installation token...");
|
||||
@@ -52,14 +48,11 @@ export async function setupGitHubInstallationToken(): Promise<string> {
|
||||
);
|
||||
}
|
||||
|
||||
// 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
|
||||
core.setSecret(tokenData.token);
|
||||
|
||||
// Set the token as an environment variable for this run
|
||||
process.env.GITHUB_INSTALLATION_TOKEN = tokenData.token;
|
||||
|
||||
return tokenData.token;
|
||||
|
||||
Reference in New Issue
Block a user