-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathgithubGetReleases.ts
More file actions
91 lines (86 loc) · 1.78 KB
/
Copy pathgithubGetReleases.ts
File metadata and controls
91 lines (86 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { got } from "got";
/**
* Fetch all Github releases without a GITHUB_TOKEN
* @param repoSlug "dappnode/DNP_VPN"
*/
export async function githubGetReleases(
repoSlug: string
): Promise<GithubRelease[]> {
const url = `https://api.github.com/repos/${repoSlug}/releases`;
return await got(url).json();
}
export interface GithubRelease {
url: string;
assets_url: string;
upload_url: string;
html_url: string;
id: number;
node_id: string;
tag_name: string;
target_commitish: string;
name: string;
draft: boolean;
author: Author;
prerelease: boolean;
created_at: Date;
published_at: Date;
assets: Asset[];
tarball_url: string;
zipball_url: string;
body: string;
}
interface Author {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
}
interface Uploader {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
}
interface Asset {
url: string;
id: number;
node_id: string;
name: string;
label: string;
uploader: Uploader;
content_type: string;
state: string;
size: number;
download_count: number;
created_at: Date;
updated_at: Date;
browser_download_url: string;
}