Adds simple integration with github library and test with publish github

This commit is contained in:
Miguel de la Cruz 2020-03-07 13:08:03 +01:00
parent d5815e4e6a
commit fdaf72aac4
206 changed files with 63806 additions and 2 deletions

25
github/github.go Normal file
View file

@ -0,0 +1,25 @@
package github
import (
"context"
"golang.org/x/oauth2"
"github.com/google/go-github/v29/github"
)
type GithubClient struct {
*github.Client
Repo string
}
func NewClient(repo, token string) *GithubClient {
ctx := context.Background()
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
return &GithubClient{
Client: client,
Repo: repo,
}
}