mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-22 09:49:56 +00:00
refactor: Outsource API calls to OctokitWrapper
This commit is contained in:
parent
2a5cf63744
commit
2483bb745d
1 changed files with 3 additions and 10 deletions
13
src/main.ts
13
src/main.ts
|
@ -28,16 +28,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