Skip to content

Commit 9777b1b

Browse files
committed
datasource/gitlab_project: Add ci_default_git_depth attribute
1 parent d321c73 commit 9777b1b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/data-sources/project.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ data "gitlab_project" "example" {
3030

3131
### Optional
3232

33+
- `ci_default_git_depth` (Number) Default number of revisions for shallow cloning.
3334
- `id` (String) The integer or path with namespace that uniquely identifies the project within the gitlab install.
3435
- `path_with_namespace` (String) The path of the repository with namespace.
3536
- `public_builds` (Boolean) If true, jobs can be viewed by non-project members.

internal/provider/data_source_gitlab_project.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ var _ = registerDataSource("gitlab_project", func() *schema.Resource {
289289
Type: schema.TypeString,
290290
Computed: true,
291291
},
292+
"ci_default_git_depth": {
293+
Description: "Default number of revisions for shallow cloning.",
294+
Type: schema.TypeInt,
295+
Optional: true,
296+
Computed: true,
297+
},
292298
"push_rules": {
293299
Description: "Push rules for the project.",
294300
Type: schema.TypeList,
@@ -429,6 +435,7 @@ func dataSourceGitlabProjectRead(ctx context.Context, d *schema.ResourceData, me
429435
d.Set("wiki_access_level", string(found.WikiAccessLevel))
430436
d.Set("squash_commit_template", found.SquashCommitTemplate)
431437
d.Set("merge_commit_template", found.MergeCommitTemplate)
438+
d.Set("ci_default_git_depth", found.CIDefaultGitDepth)
432439

433440
log.Printf("[DEBUG] Reading Gitlab project %q push rules", d.Id())
434441

0 commit comments

Comments
 (0)