setup-uv/src/download/download-latest.ts

17 lines
449 B
TypeScript
Raw Normal View History

import { OWNER, REPO } from "../utils/constants";
import * as github from "@actions/github";
2024-08-23 23:58:26 +02:00
export async function getLatestVersion(githubToken: string) {
const octokit = github.getOctokit(githubToken);
2024-08-23 23:58:26 +02:00
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
owner: OWNER,
repo: REPO,
});
2024-08-23 23:58:26 +02:00
if (!latestRelease) {
throw new Error("Could not determine latest release.");
}
return latestRelease.tag_name;
2024-08-23 23:58:26 +02:00
}