mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-04-07 07:58:48 -04:00
16 lines
449 B
TypeScript
16 lines
449 B
TypeScript
import { OWNER, REPO } from "../utils/constants";
|
|
import * as github from "@actions/github";
|
|
|
|
export async function getLatestVersion(githubToken: string) {
|
|
const octokit = github.getOctokit(githubToken);
|
|
|
|
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({
|
|
owner: OWNER,
|
|
repo: REPO,
|
|
});
|
|
|
|
if (!latestRelease) {
|
|
throw new Error("Could not determine latest release.");
|
|
}
|
|
return latestRelease.tag_name;
|
|
}
|