diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md index 33b78e32..df938d1b 100644 --- a/docs/data-sources/project.md +++ b/docs/data-sources/project.md @@ -97,10 +97,22 @@ Required: Read-Only: +- `deploy_hooks` (Attributes Set) Deploy hooks are unique URLs that allow you to trigger a deployment of a given branch. See https://vercel.com/docs/deployments/deploy-hooks for full information. (see [below for nested schema](#nestedatt--git_repository--deploy_hooks)) - `production_branch` (String) By default, every commit pushed to the main branch will trigger a Production Deployment instead of the usual Preview Deployment. You can switch to a different branch here. - `repo` (String) The name of the git repository. For example: `vercel/next.js`. - `type` (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`. + +### Nested Schema for `git_repository.deploy_hooks` + +Read-Only: + +- `id` (String) The ID of the deploy hook. +- `name` (String) The name of the deploy hook. +- `ref` (String) The branch or commit hash that should be deployed. +- `url` (String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment. + + ### Nested Schema for `password_protection` diff --git a/vercel/data_source_project.go b/vercel/data_source_project.go index 6b6596d2..2a2eddf8 100644 --- a/vercel/data_source_project.go +++ b/vercel/data_source_project.go @@ -149,6 +149,31 @@ For more detailed information, please see the [Vercel documentation](https://ver Description: "By default, every commit pushed to the main branch will trigger a Production Deployment instead of the usual Preview Deployment. You can switch to a different branch here.", Computed: true, }, + "deploy_hooks": schema.SetNestedAttribute{ + Description: "Deploy hooks are unique URLs that allow you to trigger a deployment of a given branch. See https://vercel.com/docs/deployments/deploy-hooks for full information.", + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "The ID of the deploy hook.", + Computed: true, + }, + "name": schema.StringAttribute{ + Description: "The name of the deploy hook.", + Computed: true, + }, + "ref": schema.StringAttribute{ + Description: "The branch or commit hash that should be deployed.", + Computed: true, + }, + "url": schema.StringAttribute{ + Description: "A URL that, when a POST request is made to, will trigger a new deployment.", + Computed: true, + Sensitive: true, + }, + }, + }, + }, }, }, "vercel_authentication": schema.SingleNestedAttribute{ diff --git a/vercel/data_source_project_test.go b/vercel/data_source_project_test.go index 8f1e23eb..f70f38d8 100644 --- a/vercel/data_source_project_test.go +++ b/vercel/data_source_project_test.go @@ -108,11 +108,21 @@ resource "vercel_project" "test" { prioritise_production_builds = true directory_listing = true skew_protection = "7 days" + git_repository = { + type = "github" + repo = "%[3]s" + deploy_hooks = [ + { + ref = "main" + name = "some deploy hook" + } + ] + } } data "vercel_project" "test" { name = vercel_project.test.name %[2]s } -`, name, teamID) +`, name, teamID, testGithubRepo()) }