You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
371 B
Go
22 lines
371 B
Go
package github
|
|
|
|
import (
|
|
"git.blob42.xyz/blob42/hugobot/v3/config"
|
|
"context"
|
|
|
|
"github.com/google/go-github/github"
|
|
"golang.org/x/oauth2"
|
|
)
|
|
|
|
func Auth(ctx context.Context) *github.Client {
|
|
|
|
ts := oauth2.StaticTokenSource(
|
|
&oauth2.Token{AccessToken: config.C.GithubAccessToken},
|
|
)
|
|
|
|
tc := oauth2.NewClient(ctx, ts)
|
|
client := github.NewClient(tc)
|
|
|
|
return client
|
|
}
|