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>
This commit is contained in:
CrazyMax 2020-05-07 02:15:24 +02:00 committed by GitHub
parent 88f1da8c86
commit 6c7b10c265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 269 additions and 23170 deletions

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