mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2026-04-17 03:52:59 -06:00
Use native tools
This commit is contained in:
12
src/github.ts
Normal file
12
src/github.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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 !== 'latest' ? `v${version}` : version}`;
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
|
||||
return (await http.getJson<GitHubRelease>(url)).result;
|
||||
};
|
||||
Reference in New Issue
Block a user