diff options
author | Amine Hilaly <hilalyamine@gmail.com> | 2019-06-15 02:33:06 +0200 |
---|---|---|
committer | Amine Hilaly <hilalyamine@gmail.com> | 2019-06-15 02:33:06 +0200 |
commit | f70e775dbd7c53ebb6e3cd2ec1af8d73d13449b0 (patch) | |
tree | 92ac9d1c0b837e0adf2e4728cadd430cc5393a0b /bridge/github/config.go | |
parent | d69dcce806d280ddbd6a4fb17700153bc03da90b (diff) | |
download | git-bug-f70e775dbd7c53ebb6e3cd2ec1af8d73d13449b0.tar.gz |
Store bridge type alongside the other params in the config
Diffstat (limited to 'bridge/github/config.go')
-rw-r--r-- | bridge/github/config.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go index 707b3e2f..9c1bbcbb 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -26,6 +26,7 @@ import ( const ( githubV3Url = "https://api.github.com" + keyTarget = "target" keyOwner = "owner" keyProject = "project" keyToken = "token" @@ -101,6 +102,7 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) ( return nil, fmt.Errorf("project doesn't exist or authentication token has an incorrect scope") } + conf[keyTarget] = "github" conf[keyToken] = token conf[keyOwner] = owner conf[keyProject] = project @@ -109,6 +111,10 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) ( } func (*Github) ValidateConfig(conf core.Configuration) error { + if _, ok := conf[keyTarget]; !ok { + return fmt.Errorf("missing %s key", keyTarget) + } + if _, ok := conf[keyToken]; !ok { return fmt.Errorf("missing %s key", keyToken) } |