-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
49 lines (37 loc) · 859 Bytes
/
main.go
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
package main
import (
"context"
"github.com/google/go-github/v53/github"
)
func main() {
ctx := context.Background()
client := github.NewClient(nil)
tags, err := getRepositoryTags(ctx, client)
if err != nil {
panic(err)
}
if err := generateSecurityAdvisories(ctx, tags); err != nil {
panic(err)
}
if err := generateAllSupportedPHPVersions(ctx); err != nil {
panic(err)
}
}
func getRepositoryTags(ctx context.Context, client *github.Client) ([]*github.RepositoryTag, error) {
tags := make([]*github.RepositoryTag, 0)
opts := &github.ListOptions{
PerPage: 100,
}
for {
paginated, resp, err := client.Repositories.ListTags(ctx, "shopware", "shopware", opts)
if err != nil {
return nil, err
}
tags = append(tags, paginated...)
if resp.NextPage == 0 {
break
}
opts.Page = resp.NextPage
}
return tags, nil
}