2020-08-18 23:40:31 +08: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> => {
|
2022-03-21 20:43:41 +08:00
|
|
|
const url = `https://github.com/docker/buildx/releases/${version}`;
|
2020-08-18 23:40:31 +08:00
|
|
|
const http: httpm.HttpClient = new httpm.HttpClient('setup-buildx');
|
|
|
|
return (await http.getJson<GitHubRelease>(url)).result;
|
|
|
|
};
|