1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge pull request #686 from jmks/buildkite-follow-apikey-conventions

Rename token to apiKey
This commit is contained in:
Chris Cummer 2019-10-10 20:20:32 -07:00 committed by GitHub
commit d87a597e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ func (widget *Widget) recentBuilds(pipeline PipelineSettings) ([]Build, error) {
if err != nil {
return nil, err
}
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", widget.settings.token))
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", widget.settings.apiKey))
httpClient := &http.Client{Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,

View File

@ -14,7 +14,7 @@ type PipelineSettings struct {
type Settings struct {
common *cfg.Common
token string `help:"Your Buildkite API Token"`
apiKey string `help:"Your Buildkite API Token"`
orgSlug string `help:"Organization Slug"`
pipelines []PipelineSettings `help:"An array of pipelines to get data from"`
}
@ -25,7 +25,7 @@ const defaultFocusable = true
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
settings := Settings{
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
token: ymlConfig.UString("token", os.Getenv("WTF_BUILDKITE_TOKEN")),
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_BUILDKITE_TOKEN")),
orgSlug: ymlConfig.UString("organizationSlug"),
pipelines: buildPipelineSettings(ymlConfig),
}