Skip to content

Commit 2ba7b9a

Browse files
committed
Ensure all fields are documented
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent a86c1b7 commit 2ba7b9a

3 files changed

Lines changed: 255 additions & 10 deletions

File tree

docs/data-sources/repository.md

Lines changed: 120 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ data "github_repository" "example" {
1717
}
1818
```
1919

20-
<!-- schema generated by tfplugindocs -->
20+
<!--
2121
## Schema
2222
2323
### Optional
@@ -52,7 +52,7 @@ data "github_repository" "example" {
5252
- `merge_commit_message` (String) The default value for a merge commit message.
5353
- `merge_commit_title` (String) The default value for a merge commit title.
5454
- `node_id` (String) GraphQL global node id for use with v4 API.
55-
- `pages` (List of Object, Deprecated) The repository's GitHub Pages configuration. Use the `github_repository_pages` data source instead. This field will be removed in a future version. (see [below for nested schema](#nestedatt--pages))
55+
- `pages` (List of Object, Deprecated) Use the `github_repository_pages` data source instead. This field will be removed in a future version. (see [below for nested schema](#nestedatt--pages))
5656
- `primary_language` (String) The primary language used in the repository.
5757
- `private` (Boolean) Whether the repository is private.
5858
- `repo_id` (Number) GitHub ID for the repository.
@@ -134,3 +134,121 @@ Read-Only:
134134
135135
- `owner` (String)
136136
- `repository` (String)
137+
-->
138+
139+
## Schema
140+
141+
### Optional
142+
143+
- `description` (String) A description of the repository.
144+
- `full_name` (String) The full name of the repository, in the format `owner/repo_name`.
145+
- `homepage_url` (String) URL of a page describing the project.
146+
- `name` (String) The name of the repository.
147+
148+
### Read-Only
149+
150+
- `allow_auto_merge` (Boolean) Whether the repository allows auto-merging pull requests.
151+
- `allow_forking` (Boolean) Whether the repository allows private forking; this is only relevant if the repository is owned by an organization and is private or internal.
152+
- `allow_merge_commit` (Boolean) Whether the repository allows merge commits.
153+
- `allow_rebase_merge` (Boolean) Whether the repository allows rebase merges.
154+
- `allow_squash_merge` (Boolean) Whether the repository allows squash merges.
155+
- `allow_update_branch` (Boolean) Whether the repository allows users with push access to update the base branch of pull requests.
156+
- `archived` (Boolean) Whether the repository is archived.
157+
- `default_branch` (String) The default branch of the repository.
158+
- `delete_branch_on_merge` (Boolean) Whether the repository has the option to automatically delete head branches when pull requests are merged enabled.
159+
- `fork` (Boolean) Whether the repository is a fork of another repository.
160+
- `git_clone_url` (String) URL that can be provided to `git clone` to clone the repository anonymously via the git protocol.
161+
- `has_discussions` (Boolean) Whether the repository has discussions enabled.
162+
- `has_downloads` (Boolean, Deprecated) Whether the repository has Downloads feature enabled. This attribute is no longer in use, but it hasn't been removed yet. It will be removed in a future version.
163+
- `has_issues` (Boolean) Whether the repository has issues enabled.
164+
- `has_projects` (Boolean) Whether the repository has projects enabled.
165+
- `has_wiki` (Boolean) Whether the repository has a wiki enabled.
166+
- `html_url` (String) URL to the repository on the web.
167+
- `http_clone_url` (String) URL that can be provided to `git clone` to clone the repository via HTTPS.
168+
- `id` (String) The ID of this resource.
169+
- `is_template` (Boolean) Whether the repository is a template that can be used to generate new repositories.
170+
- `merge_commit_message` (String) The default value for a merge commit message.
171+
- `merge_commit_title` (String) The default value for a merge commit title.
172+
- `node_id` (String) GraphQL global node id for use with v4 API.
173+
- `pages` (List of Object, Deprecated) Use the `github_repository_pages` data source instead. This field will be removed in a future version. (see [below for nested schema](#nestedatt--pages))
174+
- `primary_language` (String) The primary language used in the repository.
175+
- `private` (Boolean) Whether the repository is private.
176+
- `repo_id` (Number) GitHub ID for the repository.
177+
- `repository_license` (List of Object) An Array of GitHub repository licenses. Each `repository_license` block consists of the fields documented below. (see [below for nested schema](#nestedatt--repository_license))
178+
- `squash_merge_commit_message` (String) The default value for a squash merge commit message.
179+
- `squash_merge_commit_title` (String) The default value for a squash merge commit title.
180+
- `ssh_clone_url` (String) URL that can be provided to `git clone` to clone the repository via SSH.
181+
- `svn_url` (String) URL that can be provided to `svn checkout` to check out the repository via GitHub's Subversion protocol emulation.
182+
- `template` (List of Object) The repository source template configuration. (see [below for nested schema](#nestedatt--template))
183+
- `topics` (List of String) The list of topics of the repository.
184+
- `visibility` (String) Whether the repository is public, private or internal.
185+
- `web_commit_signoff_required` (Boolean) Require contributors to sign off on web-based commits.
186+
187+
<a id="nestedatt--pages"></a>
188+
### Nested Schema for `pages`
189+
190+
Read-Only:
191+
192+
- `build_type` (String)
193+
- `cname` (String)
194+
- `custom_404` (Boolean)
195+
- `html_url` (String)
196+
- `source` (List of Object) (see [below for nested schema](#nestedobjatt--pages--source))
197+
- `status` (String)
198+
- `url` (String)
199+
200+
<a id="nestedobjatt--pages--source"></a>
201+
### Nested Schema for `pages.source`
202+
203+
Read-Only:
204+
205+
- `branch` (String)
206+
- `path` (String)
207+
208+
209+
210+
<a id="nestedatt--repository_license"></a>
211+
### Nested Schema for `repository_license`
212+
213+
Read-Only:
214+
215+
- `content` (String) Content of the license file, encoded by encoding scheme mentioned below.
216+
- `download_url` (String) The URL to download the raw content of the license file.
217+
- `encoding` (String) The encoding used for the content (e.g., \"base64\").
218+
- `git_url` (String) The URL to access information about the license file as a Git blob.
219+
- `html_url` (String) The URL to view the license file on GitHub.
220+
- `license` (List of Object) The license information for the license file in the repository. (see [below for nested schema](#nestedobjatt--repository_license--license))
221+
- `name` (String) The name of the license file in the repository.
222+
- `path` (String) The path of the license file in the repository.
223+
- `sha` (String) The SHA hash of the license file.
224+
- `size` (Number) The size of the license file in bytes.
225+
- `type` (String) The type of the license file (e.g., \"file\").
226+
- `url` (String) The URL to access information about the license file on GitHub.
227+
228+
<a id="nestedobjatt--repository_license--license"></a>
229+
### Nested Schema for `repository_license.license`
230+
231+
Read-Only:
232+
233+
- `body` (String) The text of the license.
234+
- `conditions` (Set of String) Conditions associated with the license.
235+
- `description` (String) A description of the license.
236+
- `featured` (Boolean) Indicates if the license is featured.
237+
- `html_url` (String) The URL to view the license details on GitHub.
238+
- `implementation` (String) Details about the implementation of the license.
239+
- `key` (String) A key representing the license type (e.g., "apache-2.0").
240+
- `limitations` (Set of String) "Limitations associated with the license.
241+
- `name` (String) The name of the license (e.g., "Apache License 2.0").
242+
- `permissions` (Set of String) Permissions associated with the license.
243+
- `spdx_id` (String) The SPDX identifier for the license (e.g., \"Apache-2.0\").
244+
- `url` (String) The URL to access information about the license on GitHub.
245+
246+
247+
248+
<a id="nestedatt--template"></a>
249+
### Nested Schema for `template`
250+
251+
Read-Only:
252+
253+
- `owner` (String) Owner of the template repository.
254+
- `repository` (String) Name of the template repository.

github/data_source_github_repository.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ func dataSourceGithubRepository() *schema.Resource {
174174
Description: "The path of the license file in the repository.",
175175
},
176176
"license": {
177-
Type: schema.TypeList,
178-
Computed: true,
177+
Type: schema.TypeList,
178+
Computed: true,
179+
Description: "The license information for the license file in the repository.",
179180
Elem: &schema.Resource{
180181
Schema: map[string]*schema.Schema{
181182
"key": {
@@ -296,7 +297,7 @@ func dataSourceGithubRepository() *schema.Resource {
296297
Type: schema.TypeList,
297298
Computed: true,
298299
Deprecated: "Use the github_repository_pages data source instead. This field will be removed in a future version.",
299-
Description: "The repository's GitHub Pages configuration. Use the `github_repository_pages` data source instead. This field will be removed in a future version.",
300+
Description: "Use the `github_repository_pages` data source instead. This field will be removed in a future version.",
300301
Elem: &schema.Resource{
301302
Schema: map[string]*schema.Schema{
302303
"source": {
@@ -380,12 +381,14 @@ func dataSourceGithubRepository() *schema.Resource {
380381
Elem: &schema.Resource{
381382
Schema: map[string]*schema.Schema{
382383
"owner": {
383-
Type: schema.TypeString,
384-
Computed: true,
384+
Type: schema.TypeString,
385+
Computed: true,
386+
Description: "Owner of the template repository.",
385387
},
386388
"repository": {
387-
Type: schema.TypeString,
388-
Computed: true,
389+
Type: schema.TypeString,
390+
Computed: true,
391+
Description: "Name of the template repository.",
389392
},
390393
},
391394
},

templates/data-sources/repository.md.tmpl

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,128 @@ description: |-
1818
{{- end }}
1919
{{- end }}
2020

21-
{{ .SchemaMarkdown | trimspace }}
21+
<!--
22+
{{- $schema := .SchemaMarkdown | trimspace -}}
23+
{{- range $line := split $schema "\n" }}
24+
{{- if ne (trimspace $line) "<!-- schema generated by tfplugindocs -->" }}
25+
{{ $line }}
26+
{{- end }}
27+
{{- end }}
28+
-->
29+
30+
## Schema
31+
32+
### Optional
33+
34+
- `description` (String) A description of the repository.
35+
- `full_name` (String) The full name of the repository, in the format `owner/repo_name`.
36+
- `homepage_url` (String) URL of a page describing the project.
37+
- `name` (String) The name of the repository.
38+
39+
### Read-Only
40+
41+
- `allow_auto_merge` (Boolean) Whether the repository allows auto-merging pull requests.
42+
- `allow_forking` (Boolean) Whether the repository allows private forking; this is only relevant if the repository is owned by an organization and is private or internal.
43+
- `allow_merge_commit` (Boolean) Whether the repository allows merge commits.
44+
- `allow_rebase_merge` (Boolean) Whether the repository allows rebase merges.
45+
- `allow_squash_merge` (Boolean) Whether the repository allows squash merges.
46+
- `allow_update_branch` (Boolean) Whether the repository allows users with push access to update the base branch of pull requests.
47+
- `archived` (Boolean) Whether the repository is archived.
48+
- `default_branch` (String) The default branch of the repository.
49+
- `delete_branch_on_merge` (Boolean) Whether the repository has the option to automatically delete head branches when pull requests are merged enabled.
50+
- `fork` (Boolean) Whether the repository is a fork of another repository.
51+
- `git_clone_url` (String) URL that can be provided to `git clone` to clone the repository anonymously via the git protocol.
52+
- `has_discussions` (Boolean) Whether the repository has discussions enabled.
53+
- `has_downloads` (Boolean, Deprecated) Whether the repository has Downloads feature enabled. This attribute is no longer in use, but it hasn't been removed yet. It will be removed in a future version.
54+
- `has_issues` (Boolean) Whether the repository has issues enabled.
55+
- `has_projects` (Boolean) Whether the repository has projects enabled.
56+
- `has_wiki` (Boolean) Whether the repository has a wiki enabled.
57+
- `html_url` (String) URL to the repository on the web.
58+
- `http_clone_url` (String) URL that can be provided to `git clone` to clone the repository via HTTPS.
59+
- `id` (String) The ID of this resource.
60+
- `is_template` (Boolean) Whether the repository is a template that can be used to generate new repositories.
61+
- `merge_commit_message` (String) The default value for a merge commit message.
62+
- `merge_commit_title` (String) The default value for a merge commit title.
63+
- `node_id` (String) GraphQL global node id for use with v4 API.
64+
- `pages` (List of Object, Deprecated) Use the `github_repository_pages` data source instead. This field will be removed in a future version. (see [below for nested schema](#nestedatt--pages))
65+
- `primary_language` (String) The primary language used in the repository.
66+
- `private` (Boolean) Whether the repository is private.
67+
- `repo_id` (Number) GitHub ID for the repository.
68+
- `repository_license` (List of Object) An Array of GitHub repository licenses. Each `repository_license` block consists of the fields documented below. (see [below for nested schema](#nestedatt--repository_license))
69+
- `squash_merge_commit_message` (String) The default value for a squash merge commit message.
70+
- `squash_merge_commit_title` (String) The default value for a squash merge commit title.
71+
- `ssh_clone_url` (String) URL that can be provided to `git clone` to clone the repository via SSH.
72+
- `svn_url` (String) URL that can be provided to `svn checkout` to check out the repository via GitHub's Subversion protocol emulation.
73+
- `template` (List of Object) The repository source template configuration. (see [below for nested schema](#nestedatt--template))
74+
- `topics` (List of String) The list of topics of the repository.
75+
- `visibility` (String) Whether the repository is public, private or internal.
76+
- `web_commit_signoff_required` (Boolean) Require contributors to sign off on web-based commits.
77+
78+
<a id="nestedatt--pages"></a>
79+
### Nested Schema for `pages`
80+
81+
Read-Only:
82+
83+
- `build_type` (String)
84+
- `cname` (String)
85+
- `custom_404` (Boolean)
86+
- `html_url` (String)
87+
- `source` (List of Object) (see [below for nested schema](#nestedobjatt--pages--source))
88+
- `status` (String)
89+
- `url` (String)
90+
91+
<a id="nestedobjatt--pages--source"></a>
92+
### Nested Schema for `pages.source`
93+
94+
Read-Only:
95+
96+
- `branch` (String)
97+
- `path` (String)
98+
99+
100+
101+
<a id="nestedatt--repository_license"></a>
102+
### Nested Schema for `repository_license`
103+
104+
Read-Only:
105+
106+
- `content` (String) Content of the license file, encoded by encoding scheme mentioned below.
107+
- `download_url` (String) The URL to download the raw content of the license file.
108+
- `encoding` (String) The encoding used for the content (e.g., \"base64\").
109+
- `git_url` (String) The URL to access information about the license file as a Git blob.
110+
- `html_url` (String) The URL to view the license file on GitHub.
111+
- `license` (List of Object) The license information for the license file in the repository. (see [below for nested schema](#nestedobjatt--repository_license--license))
112+
- `name` (String) The name of the license file in the repository.
113+
- `path` (String) The path of the license file in the repository.
114+
- `sha` (String) The SHA hash of the license file.
115+
- `size` (Number) The size of the license file in bytes.
116+
- `type` (String) The type of the license file (e.g., \"file\").
117+
- `url` (String) The URL to access information about the license file on GitHub.
118+
119+
<a id="nestedobjatt--repository_license--license"></a>
120+
### Nested Schema for `repository_license.license`
121+
122+
Read-Only:
123+
124+
- `body` (String) The text of the license.
125+
- `conditions` (Set of String) Conditions associated with the license.
126+
- `description` (String) A description of the license.
127+
- `featured` (Boolean) Indicates if the license is featured.
128+
- `html_url` (String) The URL to view the license details on GitHub.
129+
- `implementation` (String) Details about the implementation of the license.
130+
- `key` (String) A key representing the license type (e.g., "apache-2.0").
131+
- `limitations` (Set of String) "Limitations associated with the license.
132+
- `name` (String) The name of the license (e.g., "Apache License 2.0").
133+
- `permissions` (Set of String) Permissions associated with the license.
134+
- `spdx_id` (String) The SPDX identifier for the license (e.g., \"Apache-2.0\").
135+
- `url` (String) The URL to access information about the license on GitHub.
136+
137+
138+
139+
<a id="nestedatt--template"></a>
140+
### Nested Schema for `template`
141+
142+
Read-Only:
143+
144+
- `owner` (String) Owner of the template repository.
145+
- `repository` (String) Name of the template repository.

0 commit comments

Comments
 (0)