Use new Oracle GraalVM EA builds repo.
This commit is contained in:
committed by
Fabio Niephaus
parent
076347913e
commit
cb063c121c
35
src/utils.ts
35
src/utils.ts
@@ -34,25 +34,6 @@ export async function exec(
|
||||
}
|
||||
}
|
||||
|
||||
export async function getLatestPrerelease(
|
||||
repo: string
|
||||
): Promise<c.ReleasesResponse['data'][number]> {
|
||||
const githubToken = getGitHubToken()
|
||||
const options = githubToken.length > 0 ? {auth: githubToken} : {}
|
||||
const octokit = new GitHubDotCom(options)
|
||||
const releases: c.ReleasesResponse['data'] = (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/releases', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo
|
||||
})
|
||||
).data
|
||||
const firstPrerelease = releases.find(r => r.prerelease)
|
||||
if (!firstPrerelease) {
|
||||
throw new Error(`Unable to find latest prerelease in ${repo}`)
|
||||
}
|
||||
return firstPrerelease
|
||||
}
|
||||
|
||||
export async function getLatestRelease(
|
||||
repo: string
|
||||
): Promise<c.LatestReleaseResponse['data']> {
|
||||
@@ -67,6 +48,22 @@ export async function getLatestRelease(
|
||||
).data
|
||||
}
|
||||
|
||||
export async function getContents(
|
||||
repo: string,
|
||||
path: string
|
||||
): Promise<c.ContentsResponse['data']> {
|
||||
const githubToken = getGitHubToken()
|
||||
const options = githubToken.length > 0 ? {auth: githubToken} : {}
|
||||
const octokit = new GitHubDotCom(options)
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo,
|
||||
path
|
||||
})
|
||||
).data
|
||||
}
|
||||
|
||||
export async function getTaggedRelease(
|
||||
repo: string,
|
||||
tag: string
|
||||
|
||||
Reference in New Issue
Block a user