mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-12-22 04:48:18 +00:00
feat: Add using GitHub API latest feature back in
This commit is contained in:
parent
82d97e2453
commit
c71f252745
1 changed files with 11 additions and 4 deletions
15
src/main.ts
15
src/main.ts
|
@ -10,7 +10,11 @@ import {
|
|||
install_nextflow
|
||||
} from "./functions"
|
||||
import { NextflowRelease } from "./nextflow-release"
|
||||
import { pull_releases, setup_octokit } from "./octokit-wrapper"
|
||||
import {
|
||||
pull_releases,
|
||||
pull_latest_stable_release,
|
||||
setup_octokit
|
||||
} from "./octokit-wrapper"
|
||||
|
||||
async function run(): Promise<void> {
|
||||
// CAPSULE_LOG leads to a bunch of boilerplate being output to the logs: turn
|
||||
|
@ -32,13 +36,16 @@ async function run(): Promise<void> {
|
|||
// Setup the API
|
||||
const octokit = await setup_octokit(token, cooldown, max_retries)
|
||||
|
||||
const releases = await pull_releases(octokit)
|
||||
|
||||
// Get the release info for the desired release
|
||||
let release = {} as NextflowRelease
|
||||
let resolved_version = ""
|
||||
try {
|
||||
release = await get_nextflow_release(version, releases)
|
||||
if (version === "latest" || version === "latest-stable") {
|
||||
release = await pull_latest_stable_release(octokit)
|
||||
} else {
|
||||
const releases = await pull_releases(octokit)
|
||||
release = await get_nextflow_release(version, releases)
|
||||
}
|
||||
resolved_version = release.versionNumber
|
||||
core.info(
|
||||
`Input version '${version}' resolved to Nextflow ${release["name"]}`
|
||||
|
|
Loading…
Reference in a new issue