goreleaser-action/src/github.ts
CrazyMax 6c7b10c265
feat: Use native GitHub Action tools to download assets and use GitHub API (#187)
* Use native GitHub Action tools to download assets and use GitHub API
* Fix unexpected output when tag not found
* Use GitHub Action exec
* Add screenshot

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-05-07 02:15:24 +02:00

12 lines
427 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/goreleaser/goreleaser/releases/${version}`;
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
return (await http.getJson<GitHubRelease>(url)).result;
};