mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-12-03 13:59:55 +00:00
refactor: Outsource API calls to OctokitWrapper
This commit is contained in:
parent
9c201e4232
commit
91a673d1c0
1 changed files with 3 additions and 10 deletions
13
src/main.ts
13
src/main.ts
|
@ -29,16 +29,9 @@ async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
// Setup the API
|
||||
let octokit: InstanceType<typeof GitHub> | 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 = {}
|
||||
|
|
Loading…
Reference in a new issue