diff --git a/docs/data-sources/github_enterprise_integration.md b/docs/data-sources/github_enterprise_integration.md index 4ce2d674..a77f8f66 100644 --- a/docs/data-sources/github_enterprise_integration.md +++ b/docs/data-sources/github_enterprise_integration.md @@ -33,3 +33,4 @@ data "spacelift_github_enterprise_integration" "github_enterprise_integration" { - `name` (String) Github integration name - `space_id` (String) Github integration space id - `webhook_secret` (String) Github integration webhook secret +- `webhook_url` (String) Github integration webhook url diff --git a/spacelift/data_github_enterprise_integration.go b/spacelift/data_github_enterprise_integration.go index 53a48dc9..8b9a5c96 100644 --- a/spacelift/data_github_enterprise_integration.go +++ b/spacelift/data_github_enterprise_integration.go @@ -19,6 +19,7 @@ const ( ghEnterpriseAppID = "app_id" ghEnterpriseAPIHost = "api_host" ghEnterpriseWebhookSecret = "webhook_secret" + ghEnterpriseWebhookURL = "webhook_url" defaultGHEIntegrationID = "github-enterprise-default-integration" ) @@ -73,6 +74,11 @@ func dataGithubEnterpriseIntegration() *schema.Resource { Description: "Github integration webhook secret", Computed: true, }, + ghEnterpriseWebhookURL: { + Type: schema.TypeString, + Description: "Github integration webhook url", + Computed: true, + }, ghEnterpriseAppID: { Type: schema.TypeString, Description: "Github integration app id", @@ -88,6 +94,7 @@ func dataGithubEnterpriseIntegrationRead(ctx context.Context, d *schema.Resource AppID string `graphql:"appID"` APIHost string `graphql:"apiHost"` WebhookSecret string `graphql:"webhookSecret"` + WebhookURL string `graphql:"webhookUrl"` ID string `graphql:"id"` Name string `graphql:"name"` Description string `graphql:"description"` @@ -117,6 +124,7 @@ func dataGithubEnterpriseIntegrationRead(ctx context.Context, d *schema.Resource d.SetId(githubEnterpriseIntegration.ID) d.Set(ghEnterpriseAPIHost, githubEnterpriseIntegration.APIHost) d.Set(ghEnterpriseWebhookSecret, githubEnterpriseIntegration.WebhookSecret) + d.Set(ghEnterpriseWebhookURL, githubEnterpriseIntegration.WebhookURL) d.Set(ghEnterpriseAppID, githubEnterpriseIntegration.AppID) d.Set(ghEnterpriseId, githubEnterpriseIntegration.ID) d.Set(ghEnterpriseName, githubEnterpriseIntegration.Name) diff --git a/spacelift/data_github_enterprise_integration_test.go b/spacelift/data_github_enterprise_integration_test.go index 78d29d62..77a77a7e 100644 --- a/spacelift/data_github_enterprise_integration_test.go +++ b/spacelift/data_github_enterprise_integration_test.go @@ -23,6 +23,7 @@ func TestGithubEnterpriseIntegrationData(t *testing.T) { Attribute("space_id", IsNotEmpty()), Attribute("api_host", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_API_HOST"))), Attribute("webhook_secret", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_WEBHOOK_SECRET"))), + Attribute("webhook_url", IsNotEmpty()), Attribute("app_id", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_APP_ID"))), ), }}) @@ -43,6 +44,7 @@ func TestGithubEnterpriseIntegrationData(t *testing.T) { Attribute("space_id", IsNotEmpty()), Attribute("api_host", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_API_HOST"))), Attribute("webhook_secret", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_WEBHOOK_SECRET"))), + Attribute("webhook_url", IsNotEmpty()), Attribute("app_id", Equals(os.Getenv("SPACELIFT_PROVIDER_TEST_GITHUB_ENTERPRISE_APP_ID"))), ), }})