ghaction-upx/src/github.ts
2020-05-07 12:13:21 +02:00

13 lines
408 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: string = `https://github.com/upx/upx/releases/${version}`;
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
return (await http.getJson<GitHubRelease>(url)).result;
};