这是indexloc提供的服务,不要输入任何密码
Skip to content

Add missing deploy_hooks to vercel_project data source #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/data-sources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<a id="nestedatt--git_repository--deploy_hooks"></a>
### 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.



<a id="nestedatt--password_protection"></a>
### Nested Schema for `password_protection`
Expand Down
25 changes: 25 additions & 0 deletions vercel/data_source_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
12 changes: 11 additions & 1 deletion vercel/data_source_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}