Skip to content

Commit

Permalink
feat: Move repo archiving to submodule (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea authored Jun 13, 2022
1 parent f0c21cd commit e7e0ee3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ resource "github_repository" "main" {
homepage_url = var.homepage_url
visibility = "public"
topics = var.topics
archived = var.is_archived

// Only allow squash merges
allow_merge_commit = false
Expand Down
3 changes: 3 additions & 0 deletions modules/archived/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Archived repository

Submodule to archive a module previously managed by the root module.
21 changes: 21 additions & 0 deletions modules/archived/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "github_repository" "main" {
name = var.name
archived = true

lifecycle {
ignore_changes = [
auto_init,
description,
homepage_url,
topics,
allow_merge_commit,
allow_rebase_merge,
allow_auto_merge,
delete_branch_on_merge,
has_issues,
has_downloads,
vulnerability_alerts,
pages,
]
}
}
3 changes: 3 additions & 0 deletions modules/archived/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "name" {
description = "GitHub project name"
}
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ variable "support_releases" {
description = "Whether the project uses Semantic Releases"
}

variable "is_archived" {
default = false
description = "Whether the project is archived"
}

variable "pages_source_path" {
default = null
type = string
Expand Down

0 comments on commit e7e0ee3

Please sign in to comment.