mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-15 15:10:33 +00:00
* 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>
12 lines
427 B
TypeScript
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;
|
|
};
|