Skip to content

Commit 13c8f36

Browse files
authored
feat: Drop projects (#9)
Github has deprecated them.
1 parent 232621b commit 13c8f36

File tree

3 files changed

+0
-49
lines changed

3 files changed

+0
-49
lines changed

main.tf

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ locals {
1010
private_visibility = local.private ? "private" : "public"
1111
visibility = var.visibility == null ? lookup(var.defaults, "visibility", local.private_visibility) : var.visibility
1212
has_issues = var.has_issues == null ? lookup(var.defaults, "has_issues", false) : var.has_issues
13-
has_projects = var.has_projects == null ? lookup(var.defaults, "has_projects", false) : length(var.projects) > 0 ? true : var.has_projects
1413
has_downloads = var.has_downloads == null ? lookup(var.defaults, "has_downloads", false) : var.has_downloads
1514
has_wiki = var.has_wiki == null ? lookup(var.defaults, "has_wiki", false) : var.has_wiki
1615
allow_merge_commit = var.allow_merge_commit == null ? lookup(var.defaults, "allow_merge_commit", true) : var.allow_merge_commit
@@ -103,7 +102,6 @@ resource "github_repository" "repository" {
103102
homepage_url = local.homepage_url
104103
visibility = local.visibility
105104
has_issues = local.has_issues
106-
has_projects = local.has_projects
107105
has_wiki = local.has_wiki
108106
allow_merge_commit = local.allow_merge_commit
109107
allow_rebase_merge = local.allow_rebase_merge
@@ -528,24 +526,6 @@ resource "github_repository_deploy_key" "deploy_key" {
528526
read_only = each.value.read_only
529527
}
530528

531-
# ---------------------------------------------------------------------------------------------------------------------
532-
# Projects
533-
# ---------------------------------------------------------------------------------------------------------------------
534-
535-
locals {
536-
projects = { for i in var.projects : lookup(i, "id", lower(i.name)) => merge({
537-
body = null
538-
}, i) }
539-
}
540-
541-
resource "github_repository_project" "repository_project" {
542-
for_each = local.projects
543-
544-
repository = github_repository.repository.name
545-
name = each.value.name
546-
body = each.value.body
547-
}
548-
549529
# ---------------------------------------------------------------------------------------------------------------------
550530
# Webhooks
551531
# ---------------------------------------------------------------------------------------------------------------------

outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ output "collaborators" {
4646
description = "A map of collaborator objects keyed by collaborator.name."
4747
}
4848

49-
output "projects" {
50-
value = github_repository_project.repository_project
51-
description = "A map of projects keyed by project input id."
52-
}
53-
5449
output "issue_labels" {
5550
value = github_issue_label.label
5651
description = "A map of issue labels keyed by label input id or name."

variables.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ variable "has_issues" {
6060
default = null
6161
}
6262

63-
variable "has_projects" {
64-
description = "(Optional) Set to true to enable the GitHub Projects features on the repository. Per the github documentation when in an organization that has disabled repository projects it will default to false and will otherwise default to true. If you specify true when it has been disabled it will return an error. (Default: false)"
65-
type = bool
66-
default = null
67-
}
68-
6963
variable "has_wiki" {
7064
description = "(Optional) Set to true to enable the GitHub Wiki features on the repository. (Default: false)"
7165
type = bool
@@ -478,24 +472,6 @@ variable "deploy_keys_computed" {
478472
default = []
479473
}
480474

481-
variable "projects" {
482-
description = "(Optional) Create and manage projects for GitHub repository."
483-
type = list(object({
484-
name = string
485-
body = string
486-
}))
487-
488-
# Example:
489-
# projects = [
490-
# {
491-
# name = "Testproject"
492-
# body = "This is a fancy test project for testing"
493-
# }
494-
# ]
495-
496-
default = []
497-
}
498-
499475
variable "webhooks" {
500476
description = "(Optional) Configuring webhooks. For details please check: https://www.terraform.io/docs/providers/github/r/repository_webhook.html"
501477
type = any

0 commit comments

Comments
 (0)