ghaction-upx/src/github.ts

13 lines
408 B
TypeScript
Raw Normal View History

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