Skip to content

Commit c1e131f

Browse files
committed
datasource/gitlab_repository_file: cleanup for merge
1 parent b02693f commit c1e131f

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

docs/data-sources/repository_file.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
page_title: "gitlab_repository_file Data Source - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
6-
Allows you to receive information about file in repository like name, size, content. File content is Base64 encoded. This endpoint can be accessed without authentication if the repository is publicly accessible.
6+
The gitlab_repository_file data source allows details of a file in a repository to be retrieved.
7+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/repository_files.html
78
---
89

910
# gitlab_repository_file (Data Source)
1011

11-
Allows you to receive information about file in repository like name, size, content. File content is Base64 encoded. This endpoint can be accessed without authentication if the repository is publicly accessible.
12+
The `gitlab_repository_file` data source allows details of a file in a repository to be retrieved.
1213

14+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/repository_files.html)
1315

16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_repository_file" "example" {
20+
project = "example"
21+
ref = "main"
22+
file_path = "README.md"
23+
}
24+
```
1425

1526
<!-- schema generated by tfplugindocs -->
1627
## Schema
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "gitlab_repository_file" "example" {
2+
project = "example"
3+
ref = "main"
4+
file_path = "README.md"
5+
}

internal/provider/data_source_gitlab_repository_file.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import (
1212

1313
var _ = registerDataSource("gitlab_repository_file", func() *schema.Resource {
1414
return &schema.Resource{
15-
Description: "Allows you to receive information about file in repository like name, size, content. File content is Base64 encoded. This endpoint can be accessed without authentication if the repository is publicly accessible.",
15+
Description: `The ` + "`gitlab_repository_file`" + ` data source allows details of a file in a repository to be retrieved.
16+
17+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/repository_files.html)`,
18+
1619
ReadContext: dataSourceGitlabRepositoryFileRead,
1720
Schema: map[string]*schema.Schema{
1821
"project": {

internal/provider/data_source_gitlab_repository_file_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func testAccDataSourceGitlabRepositoryFile(src, n string) resource.TestCheckFunc
3737
testAttributes := []string{
3838
"project",
3939
"file_path",
40-
"file_path",
4140
"size",
4241
"encoding",
4342
"content",

0 commit comments

Comments
 (0)