|
|
|
|
@ -23,6 +23,12 @@ func Provider() terraform.ResourceProvider {
|
|
|
|
|
DefaultFunc: schema.EnvDefaultFunc("GITHUB_ORGANIZATION", nil),
|
|
|
|
|
Description: descriptions["organization"],
|
|
|
|
|
},
|
|
|
|
|
"base_url": &schema.Schema{
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
Optional: true,
|
|
|
|
|
DefaultFunc: schema.EnvDefaultFunc("GITHUB_BASE_URL", ""),
|
|
|
|
|
Description: descriptions["base_url"],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
ResourcesMap: map[string]*schema.Resource{
|
|
|
|
|
@ -43,6 +49,8 @@ func init() {
|
|
|
|
|
"token": "The OAuth token used to connect to GitHub.",
|
|
|
|
|
|
|
|
|
|
"organization": "The GitHub organization name to manage.",
|
|
|
|
|
|
|
|
|
|
"base_url": "The GitHub Base API URL",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -50,6 +58,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
|
|
|
|
|
config := Config{
|
|
|
|
|
Token: d.Get("token").(string),
|
|
|
|
|
Organization: d.Get("organization").(string),
|
|
|
|
|
BaseURL: d.Get("base_url").(string),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return config.Client()
|
|
|
|
|
|