mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-19 08:51:54 +00:00
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:
parent
88f1da8c86
commit
6c7b10c265
16 changed files with 269 additions and 23170 deletions
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/goreleaser/goreleaser/releases/${version}`;
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('goreleaser-action');
|
||||
return (await http.getJson<GitHubRelease>(url)).result;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue