ghaction-upx/src/github.ts
CrazyMax b7511689c6
update dev dependencies and workflow (#168)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-24 20:30:15 +02:00

13 lines
400 B
TypeScript

import * as httpm from '@actions/http-client';
export interface GitHubRelease {
id: number;
tag_name: string;
}
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
const url = `https://github.com/upx/upx/releases/${version}`;
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
return (await http.getJson<GitHubRelease>(url)).result;
};