From c6c463250412c1670a35509da9da1b43a4a53e9d Mon Sep 17 00:00:00 2001 From: Matthias Zepper Date: Thu, 5 Oct 2023 19:50:34 +0200 Subject: [PATCH] Fix some linting errors. --- src/main.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 06fdbb2..0c83e4f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,10 +15,10 @@ interface Resource { */ export async function run(): Promise { try { - let lowerBound: number = parseInt(core.getInput('lowerBound')) || 50 - let actionToTake: string = core.getInput('actionToTake') || 'sweep' - let resource: string = core.getInput('resource') || 'core' - let token: string = + const lowerBound: number = parseInt(core.getInput('lowerBound')) || 50 + const actionToTake: string = core.getInput('actionToTake') || 'sweep' + const resource: string = core.getInput('resource') || 'core' + const token: string = core.getInput('token') || String(process.env.GITHUB_TOKEN) // corroborate that resource is one of the valid resource types / quotas: @@ -68,7 +68,7 @@ export async function run(): Promise { ) switch (actionToTake) { - case 'sleep': + case 'sleep': { // calculate the number of seconds until the rate limit resets (getTime() returns milliseconds, the API UTC epoch seconds) const seconds_to_reset = reset - Math.round(new Date().getTime() / 1000) @@ -85,6 +85,7 @@ export async function run(): Promise { core.info(`The API limit has been reset. Farewell!`) break + } default: core.setFailed( `The API limit of ${resource} was too low to proceed.`