Skip to content

Commit dc52c4d

Browse files
authored
deprecate: mark has_downloads variable as deprecated (#17)
* deprecate: mark has_downloads variable as deprecated The `has_downloads` attribute is officially deprecated in the GitHub provider (v6.10.2) and will be removed in a future version. This change: - Adds deprecation notice to variable description - Removes has_downloads from github_repository resource - Adds check block to warn users who set has_downloads=true - Bumps minimum Terraform version to 1.5 (required for check blocks) The variable is retained for backward compatibility so existing configurations won't break, but users will see a warning. * docs: update README with Terraform 1.5 requirement and deprecation notice Auto-generated documentation updates reflecting: - Minimum Terraform version changed to >= 1.5 - has_downloads variable marked as deprecated * fix: remove unused has_downloads variable from examples The deprecated has_downloads variable was declared in both example files but not used, causing tflint to fail CI with "variable is declared but not used" warnings. * fix: remove has_downloads from fixtures file The terratest was failing because the fixtures file still referenced the has_downloads variable which was removed from the example. * fix: remove has_downloads assertion from test The has_downloads field is deprecated by GitHub and was removed from the module. The test assertion needs to be removed as well.
1 parent 2129a2a commit dc52c4d

12 files changed

Lines changed: 13 additions & 23 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Here is an example of using this module:
109109

110110
| Name | Version |
111111
|------|---------|
112-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
112+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5 |
113113
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 6.9.0 |
114114

115115
## Providers
@@ -178,7 +178,7 @@ Here is an example of using this module:
178178
| <a name="input_fork"></a> [fork](#input\_fork) | Configuration for forking an existing repository | <pre>object({<br/> source_owner = string<br/> source_repo = string<br/> })</pre> | `null` | no |
179179
| <a name="input_gitignore_template"></a> [gitignore\_template](#input\_gitignore\_template) | Gitignore template | `string` | `null` | no |
180180
| <a name="input_has_discussions"></a> [has\_discussions](#input\_has\_discussions) | Whether the repository has discussions enabled | `bool` | `false` | no |
181-
| <a name="input_has_downloads"></a> [has\_downloads](#input\_has\_downloads) | Whether the repository has downloads enabled | `bool` | `false` | no |
181+
| <a name="input_has_downloads"></a> [has\_downloads](#input\_has\_downloads) | (DEPRECATED) Whether the repository has downloads enabled. This attribute is deprecated by GitHub and will be removed in a future version of this module. | `bool` | `false` | no |
182182
| <a name="input_has_issues"></a> [has\_issues](#input\_has\_issues) | Whether the repository has issues enabled | `bool` | `false` | no |
183183
| <a name="input_has_projects"></a> [has\_projects](#input\_has\_projects) | Whether the repository has projects enabled | `bool` | `false` | no |
184184
| <a name="input_has_wiki"></a> [has\_wiki](#input\_has\_wiki) | Whether the repository has wiki enabled | `bool` | `false` | no |

examples/complete/fixtures.us-east-2.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ has_issues = true
77
has_discussions = true
88
has_projects = true
99
has_wiki = true
10-
has_downloads = true
1110
is_template = true
1211
allow_merge_commit = true
1312
merge_commit_title = "MERGE_MESSAGE"

examples/complete/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module "example" {
1919
is_template = var.is_template
2020

2121
has_discussions = var.has_discussions
22-
has_downloads = var.has_downloads
2322
has_issues = var.has_issues
2423
has_projects = var.has_projects
2524
has_wiki = var.has_wiki

examples/complete/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ variable "has_wiki" {
7575
default = false
7676
}
7777

78-
variable "has_downloads" {
79-
description = "Whether the repository has downloads enabled"
80-
type = bool
81-
default = false
82-
}
83-
8478
variable "is_template" {
8579
description = "Whether the repository is a template"
8680
type = bool

examples/complete/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5"
33

44
required_providers {
55
github = {

examples/minimum/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module "example" {
1818
is_template = var.is_template
1919

2020
has_discussions = var.has_discussions
21-
has_downloads = var.has_downloads
2221
has_issues = var.has_issues
2322
has_projects = var.has_projects
2423
has_wiki = var.has_wiki

examples/minimum/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ variable "has_wiki" {
6666
default = false
6767
}
6868

69-
variable "has_downloads" {
70-
description = "Whether the repository has downloads enabled"
71-
type = bool
72-
default = false
73-
}
74-
7569
variable "is_template" {
7670
description = "Whether the repository is a template"
7771
type = bool

examples/minimum/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5"
33

44
required_providers {
55
github = {

main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ resource "github_repository" "default" {
2828
is_template = var.is_template
2929

3030
has_discussions = var.has_discussions
31-
has_downloads = var.has_downloads
3231
has_issues = var.has_issues
3332
has_projects = var.has_projects
3433
has_wiki = var.has_wiki
@@ -595,3 +594,10 @@ resource "github_repository_ruleset" "default" {
595594
github_repository_environment.default
596595
]
597596
}
597+
598+
check "has_downloads_deprecation" {
599+
assert {
600+
condition = var.has_downloads == false
601+
error_message = "DEPRECATION WARNING: The 'has_downloads' variable is deprecated. GitHub has removed this feature and this variable will be removed in a future version of this module. Please remove 'has_downloads' from your configuration."
602+
}
603+
}

test/src/examples_complete_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ func TestExamplesComplete(t *testing.T) {
7676
assert.Equal(t, true, repo.GetHasProjects())
7777
assert.Equal(t, true, repo.GetHasDiscussions())
7878
assert.Equal(t, true, repo.GetHasWiki())
79-
assert.Equal(t, true, repo.GetHasDownloads())
8079
assert.Equal(t, true, repo.GetIsTemplate())
8180
assert.Equal(t, true, repo.GetAllowSquashMerge())
8281
assert.Equal(t, "COMMIT_OR_PR_TITLE", repo.GetSquashMergeCommitTitle())

0 commit comments

Comments
 (0)