mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Rename token to apiKey
This commit is contained in:
parent
02a39915dd
commit
016bef7f79
@ -46,7 +46,7 @@ func (widget *Widget) recentBuilds(pipeline PipelineSettings) ([]Build, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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{
|
httpClient := &http.Client{Transport: &http.Transport{
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
|
@ -14,7 +14,7 @@ type PipelineSettings struct {
|
|||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
common *cfg.Common
|
common *cfg.Common
|
||||||
token string `help:"Your Buildkite API Token"`
|
apiKey string `help:"Your Buildkite API Token"`
|
||||||
orgSlug string `help:"Organization Slug"`
|
orgSlug string `help:"Organization Slug"`
|
||||||
pipelines []PipelineSettings `help:"An array of pipelines to get data from"`
|
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 {
|
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||||
settings := Settings{
|
settings := Settings{
|
||||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
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"),
|
orgSlug: ymlConfig.UString("organizationSlug"),
|
||||||
pipelines: buildPipelineSettings(ymlConfig),
|
pipelines: buildPipelineSettings(ymlConfig),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user