1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00
goreleaser/clients/github.go

17 lines
299 B
Go
Raw Normal View History

2017-01-14 14:50:46 -02:00
package clients
import (
"context"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
2017-01-14 19:23:58 -02:00
func GitHub(token string) *github.Client {
2017-01-14 14:50:46 -02:00
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: token},
)
tc := oauth2.NewClient(context.Background(), ts)
return github.NewClient(tc)
}