mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-24 04:16:27 +02:00
16 lines
353 B
Go
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))
|
|
}
|