Skip to content

Commit eac908e

Browse files
authored
feat: fork Drift (#1154)
1 parent 73e817a commit eac908e

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

tf/deployment/modules/shared/github/org/repositories.tf

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable "repositories" {
77
projects = optional(bool, false)
88
issues = optional(bool, true)
99
archived = optional(bool, false)
10-
fork = optional(bool, false)
10+
fork_source = optional(string)
1111
collaborators = optional(bool, false)
1212
require_codeowners = optional(bool, false)
1313
license = optional(string, "AGPL")
@@ -79,7 +79,7 @@ variable "repositories" {
7979
{
8080
name = "native_video_player",
8181
description = "A Flutter widget to play videos on iOS and Android using a native implementation.",
82-
fork = true
82+
fork_source = "albemala/native_video_player"
8383
},
8484
{
8585
name = "justified-layout",
@@ -144,6 +144,12 @@ variable "repositories" {
144144
name = "retro",
145145
description = "ISO generator for the Immich Retro Demo DVD",
146146
license = "MIT"
147+
},
148+
{
149+
name = "drift",
150+
description = "Drift is an easy to use, reactive, typesafe persistence library for Dart & Flutter.",
151+
fork_source = "simolus3/drift",
152+
url = "https://pub.dev/packages/drift"
147153
}
148154
]
149155
}
@@ -153,6 +159,11 @@ import {
153159
to = github_repository.repositories["retro"]
154160
}
155161

162+
import {
163+
id = "drift"
164+
to = github_repository.repositories["drift"]
165+
}
166+
156167
resource "github_repository" "repositories" {
157168
for_each = { for repo in var.repositories : repo.name => repo }
158169
name = each.value.name
@@ -175,6 +186,10 @@ resource "github_repository" "repositories" {
175186
homepage_url = coalesce(each.value.url, "https://immich.app")
176187
squash_merge_commit_title = "PR_TITLE"
177188

189+
fork = each.value.fork_source != null
190+
source_owner = each.value.fork_source != null ? split("/", each.value.fork_source)[0] : null
191+
source_repo = each.value.fork_source != null ? split("/", each.value.fork_source)[1] : null
192+
178193
lifecycle {
179194
ignore_changes = [
180195
# Provider bug when merge commit is disabled, it can't update these
@@ -412,7 +427,7 @@ import {
412427
resource "github_repository_file" "license_files" {
413428
for_each = {
414429
for repo in var.repositories : repo.name => repo
415-
if !coalesce(repo.fork, false) && !coalesce(repo.archived, false)
430+
if repo.fork_source == null && !coalesce(repo.archived, false)
416431
}
417432
repository = each.value.name
418433
file = "LICENSE"

0 commit comments

Comments
 (0)