mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
18 lines
424 B
TypeScript
18 lines
424 B
TypeScript
import {GITHUB_API_URL, REPO_NAME} from "./constants";
|
|
import {getError} from "./utils";
|
|
|
|
export async function getLatestTag() {
|
|
let latestTag: string;
|
|
const res = await fetch(`${GITHUB_API_URL}/repos/${REPO_NAME}/releases/latest`);
|
|
|
|
if (res.ok) {
|
|
const data = await res.json();
|
|
|
|
latestTag = data.tag_name;
|
|
} else {
|
|
throw await getError("GitHub latest tag fetch failed", res);
|
|
}
|
|
|
|
return latestTag;
|
|
}
|