mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-22 01:46:04 +00:00
chore: handle octokit typing
This commit is contained in:
parent
7a0ec2a9b4
commit
c19a8b88ef
1 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
||||||
import * as exec from '@actions/exec'
|
import * as exec from '@actions/exec'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
|
import {GitHub} from '@actions/github/lib/utils'
|
||||||
import * as tc from '@actions/tool-cache'
|
import * as tc from '@actions/tool-cache'
|
||||||
import {install_nextflow, nextflow_bin_url, release_data} from './functions'
|
import {install_nextflow, nextflow_bin_url, release_data} from './functions'
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ async function run(): Promise<void> {
|
||||||
let resolved_version = ''
|
let resolved_version = ''
|
||||||
|
|
||||||
// Setup the API
|
// Setup the API
|
||||||
let octokit = {}
|
let octokit: InstanceType<typeof GitHub> | undefined
|
||||||
try {
|
try {
|
||||||
octokit = github.getOctokit(token)
|
octokit = github.getOctokit(token)
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
|
@ -31,7 +32,9 @@ async function run(): Promise<void> {
|
||||||
// Get the release info for the desired release
|
// Get the release info for the desired release
|
||||||
let release = {}
|
let release = {}
|
||||||
try {
|
try {
|
||||||
|
if (octokit !== undefined) {
|
||||||
release = await release_data(version, octokit)
|
release = await release_data(version, octokit)
|
||||||
|
}
|
||||||
resolved_version = release['tag_name']
|
resolved_version = release['tag_name']
|
||||||
core.info(
|
core.info(
|
||||||
`Input version '${version}' resolved to Nextflow ${release['name']}`
|
`Input version '${version}' resolved to Nextflow ${release['name']}`
|
||||||
|
|
Loading…
Reference in a new issue