| // Copyright 2022 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "golang.org/x/build/buildenv" |
| "golang.org/x/build/gerrit" |
| "golang.org/x/build/internal/secret" |
| // gerritAPIURL is the Gerrit API URL. |
| gerritAPIURL = "https://go-review.googlesource.com" |
| // loadGerritAuth loads Gerrit API credentials. |
| func loadGerritAuth() (gerrit.Auth, error) { |
| sc, err := secret.NewClientInProject(buildenv.Production.ProjectName) |
| token, err := sc.Retrieve(context.Background(), secret.NameGobotPassword) |
| return gerrit.BasicAuth("git-gobot.golang.org", token), nil |