mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-25 18:59:55 +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
|
install_nextflow
|
||||||
} from "./functions"
|
} from "./functions"
|
||||||
import { NextflowRelease } from "./nextflow-release"
|
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> {
|
async function run(): Promise<void> {
|
||||||
// CAPSULE_LOG leads to a bunch of boilerplate being output to the logs: turn
|
// 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
|
// Setup the API
|
||||||
const octokit = await setup_octokit(token, cooldown, max_retries)
|
const octokit = await setup_octokit(token, cooldown, max_retries)
|
||||||
|
|
||||||
const releases = await pull_releases(octokit)
|
|
||||||
|
|
||||||
// Get the release info for the desired release
|
// Get the release info for the desired release
|
||||||
let release = {} as NextflowRelease
|
let release = {} as NextflowRelease
|
||||||
let resolved_version = ""
|
let resolved_version = ""
|
||||||
try {
|
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
|
resolved_version = release.versionNumber
|
||||||
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