From c19a8b88ef01cd2ae4a1a5d08170552c5a29f5aa Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Sun, 13 Nov 2022 19:31:35 -0600 Subject: [PATCH] chore: handle octokit typing --- src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 40dc9d1..c337fdc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,6 +2,7 @@ import * as core from '@actions/core' import * as exec from '@actions/exec' import * as fs from 'fs' import * as github from '@actions/github' +import {GitHub} from '@actions/github/lib/utils' import * as tc from '@actions/tool-cache' import {install_nextflow, nextflow_bin_url, release_data} from './functions' @@ -17,7 +18,7 @@ async function run(): Promise { let resolved_version = '' // Setup the API - let octokit = {} + let octokit: InstanceType | undefined try { octokit = github.getOctokit(token) } catch (e: unknown) { @@ -31,7 +32,9 @@ async function run(): Promise { // Get the release info for the desired release let release = {} try { - release = await release_data(version, octokit) + if (octokit !== undefined) { + release = await release_data(version, octokit) + } resolved_version = release['tag_name'] core.info( `Input version '${version}' resolved to Nextflow ${release['name']}`