1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
goreleaser/clients/github.go
Carlos Alexandro Becker 523431bd0d
context everywhere
2017-02-23 16:01:54 -03:00

16 lines
353 B
Go

package clients
import (
"github.com/google/go-github/github"
"github.com/goreleaser/goreleaser/context"
"golang.org/x/oauth2"
)
// GitHub client for the given token
func GitHub(ctx *context.Context) *github.Client {
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: ctx.Token},
)
return github.NewClient(oauth2.NewClient(ctx, ts))
}