1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-11-25 22:41:44 +02:00

feat: support custom tokens in Homebrew & Scoop (#1650)

This commit is contained in:
Radek Simko
2020-07-06 21:12:41 +01:00
committed by GitHub
parent 0d4f605388
commit ab8bb7f2f3
18 changed files with 258 additions and 75 deletions

View File

@@ -34,12 +34,12 @@ func getInstanceURL(apiURL string) (string, error) {
}
// NewGitea returns a gitea client implementation.
func NewGitea(ctx *context.Context) (Client, error) {
func NewGitea(ctx *context.Context, token string) (Client, error) {
instanceURL, err := getInstanceURL(ctx.Config.GiteaURLs.API)
if err != nil {
return nil, err
}
client := gitea.NewClient(instanceURL, ctx.Token)
client := gitea.NewClient(instanceURL, token)
transport := &http.Transport{
TLSClientConfig: &tls.Config{
// nolint: gosec
@@ -56,7 +56,7 @@ func NewGitea(ctx *context.Context) (Client, error) {
func (c *giteaClient) CreateFile(
ctx *context.Context,
commitAuthor config.CommitAuthor,
repo config.Repo,
repo Repo,
content []byte,
path,
message string,