mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-25 18:59:55 +00:00
feat: Add nextflow_release function
WIth the goal being to convert Octokit data into NextflowRelease objects, create a function that can do that in one line.
This commit is contained in:
parent
a97128956e
commit
ca8fcaccab
1 changed files with 15 additions and 0 deletions
|
@ -8,6 +8,21 @@ export type NextflowRelease = {
|
|||
allBinaryURL: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the raw OctoKit data into a structured NextflowRelease
|
||||
* @param data A "release" data struct from OctoKit
|
||||
* @returns `data` converted into a `NextflowRelease`
|
||||
*/
|
||||
export function nextflow_release(data: object): NextflowRelease {
|
||||
const nf_release: NextflowRelease = {
|
||||
versionNumber: data["tag_name"],
|
||||
isEdge: data["prerelease"],
|
||||
binaryURL: nextflow_bin_url(data, false),
|
||||
allBinaryURL: nextflow_bin_url(data, true)
|
||||
}
|
||||
return nf_release
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the download URL of a Nextflow binary
|
||||
* @param release A "release" data struct from OctoKit
|
||||
|
|
Loading…
Reference in a new issue