From 990ff5fef79fa673bc17cdd129811f1c1fbfe0d0 Mon Sep 17 00:00:00 2001 From: Rangga Fajar Oktariansyah <86386385+FajarKim@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:51:32 +0700 Subject: [PATCH] fix: replace any types with proper NodeJS process.env type in getToken.ts --- src/getToken.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/getToken.ts b/src/getToken.ts index 4d67cfc0..b581e6e9 100644 --- a/src/getToken.ts +++ b/src/getToken.ts @@ -10,15 +10,15 @@ dotenv.config(); * @returns {string} - The GitHub token. */ function getToken(bearerHeader: boolean): string { -const getEnvirontment: any = process.env; - let getGHEnvirontment: any = Object.keys(getEnvirontment).filter((key) => + const getEnvironment = process.env as Record; + const getGHEnvironmentKeys = Object.keys(getEnvironment).filter((key) => key.startsWith("GH_TOKEN") ); - getGHEnvirontment = getGHEnvirontment.map((key: string) => getEnvirontment[key]); + const getGHEnvironmentValues = getGHEnvironmentKeys.map((key: string) => getEnvironment[key]); // Select a random GitHub environment variable let getGHToken: string = - getGHEnvirontment[Math.floor(Math.random() * getGHEnvirontment.length)]; + getGHEnvironmentValues[Math.floor(Math.random() * getGHEnvironmentValues.length)] || ""; // If no GitHub environment variable is found, get the token from GitHub Actions inputs if (!getGHToken) { @@ -36,4 +36,4 @@ const getEnvirontment: any = process.env; return getGHToken; } -export default getToken; +export default getToken; \ No newline at end of file