From 91a673d1c062265119fdbb25a777f42f8117217f Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sat, 23 Dec 2023 10:46:15 -0700 Subject: [PATCH] refactor: Outsource API calls to OctokitWrapper --- src/main.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7288ca4..6a8dff6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,16 +29,9 @@ async function run(): Promise { } // Setup the API - let octokit: InstanceType | undefined - try { - octokit = github.getOctokit(token) - } catch (e: unknown) { - if (e instanceof Error) { - core.setFailed( - `Could not authenticate to GitHub Releases API with provided token\n${e.message}` - ) - } - } + const octokit = await setup_octokit(token) + + const releases = await pull_releases(octokit) // Get the release info for the desired release let release = {}