You've already forked go-semantic-release
refactor(*): clean up code
This commit is contained in:
19
internal/releaser/util/util.go
Normal file
19
internal/releaser/util/util.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
//CreateBearerHTTPClient with given token
|
||||
func CreateBearerHTTPClient(ctx context.Context, token string) *http.Client {
|
||||
tokenSource := oauth2.StaticTokenSource(&oauth2.Token{
|
||||
AccessToken: token},
|
||||
)
|
||||
|
||||
client := oauth2.NewClient(ctx, tokenSource)
|
||||
|
||||
return client
|
||||
}
|
||||
Reference in New Issue
Block a user