Skip to content

Commit 010f61d

Browse files
upgrade@4127073556 (#116)
Co-authored-by: galargh <[email protected]>
1 parent f9fcfe4 commit 010f61d

File tree

9 files changed

+22
-26
lines changed

9 files changed

+22
-26
lines changed

.github/workflows/apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Setup terraform
8888
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
8989
with:
90-
terraform_version: 1.1.4
90+
terraform_version: 1.3.7
9191
- name: Initialize terraform
9292
run: terraform init
9393
- name: Terraform Plan Download

.github/workflows/clean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Setup terraform
7474
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
7575
with:
76-
terraform_version: 1.1.4
76+
terraform_version: 1.3.7
7777
terraform_wrapper: false
7878
- name: Initialize terraform
7979
run: terraform init -upgrade

.github/workflows/fix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
- name: Setup terraform
9797
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
9898
with:
99-
terraform_version: 1.1.4
99+
terraform_version: 1.3.7
100100
- name: Initialize terraform
101101
run: terraform init
102102
working-directory: terraform
@@ -125,7 +125,7 @@ jobs:
125125
steps:
126126
- name: Generate app token
127127
id: token
128-
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c # v1.7.0
128+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
129129
with:
130130
app_id: ${{ secrets.RW_GITHUB_APP_ID }}
131131
installation_id: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}

.github/workflows/plan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Setup terraform
8383
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
8484
with:
85-
terraform_version: 1.1.4
85+
terraform_version: 1.3.7
8686
- name: Initialize terraform
8787
run: terraform init
8888
working-directory: terraform
@@ -121,7 +121,7 @@ jobs:
121121
- name: Setup terraform
122122
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
123123
with:
124-
terraform_version: 1.1.4
124+
terraform_version: 1.3.7
125125
terraform_wrapper: false
126126
- name: Initialize terraform
127127
run: terraform init
@@ -154,7 +154,7 @@ jobs:
154154
echo 'EOF' >> $GITHUB_ENV
155155
working-directory: terraform
156156
- name: Comment on pull request
157-
uses: marocchino/sticky-pull-request-comment@adca94abcaf73c10466a71cc83ae561fd66d1a56 # v2.3.0
157+
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
158158
with:
159159
number: ${{ github.event.pull_request.number }}
160160
message: |

.github/workflows/sync.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Setup terraform
6868
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
6969
with:
70-
terraform_version: 1.1.4
70+
terraform_version: 1.3.7
7171
terraform_wrapper: false
7272
- name: Initialize terraform
7373
run: terraform init -upgrade
@@ -103,7 +103,7 @@ jobs:
103103
steps:
104104
- name: Generate app token
105105
id: token
106-
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c # v1.7.0
106+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
107107
with:
108108
app_id: ${{ secrets.RW_GITHUB_APP_ID }}
109109
installation_id: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5656
- how sync handles ignored types
5757
- how indices are represented in the state (always lowercase)
5858
- how sync handles pending invitations (now it does not ignore them)
59+
- removed references to other resources from for_each expressions

scripts/src/actions/shared/add-file-to-all-repos.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export async function addFileToAllRepos(
1818
for (const repository of repositories) {
1919
const file = new RepositoryFile(repository.name, name)
2020
file.content = content
21-
file.overwrite_on_create = true
2221
if (!config.someResource(file)) {
2322
core.info(`Adding ${file.file} file to ${file.repository} repository`)
2423
config.addResource(file)

terraform/resources.tf

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ resource "github_branch_protection" "this" {
105105
for repository, repository_config in lookup(local.config, "repositories", {}) :
106106
{
107107
for pattern, config in lookup(repository_config, "branch_protection", {}) : lower("${repository}:${pattern}") => merge(config, {
108-
pattern = pattern
109-
repository_id = github_repository.this[lower(repository)].node_id
108+
pattern = pattern
109+
repository_key = lower(repository)
110110
})
111111
}
112112
]...)
113113

114114
pattern = each.value.pattern
115-
repository_id = each.value.repository_id
115+
repository_id = github_repository.this[each.value.repository_key].node_id
116116
allows_deletions = try(each.value.allows_deletions, null)
117117
allows_force_pushes = try(each.value.allows_force_pushes, null)
118118
enforce_admins = try(each.value.enforce_admins, null)
@@ -139,10 +139,6 @@ resource "github_branch_protection" "this" {
139139
strict = try(required_status_checks.value["strict"], null)
140140
}
141141
}
142-
143-
lifecycle {
144-
ignore_changes = []
145-
}
146142
}
147143

148144
resource "github_team" "this" {
@@ -170,7 +166,7 @@ resource "github_team_repository" "this" {
170166
for permission, teams in lookup(repository_config, "teams", {}) : {
171167
for team in teams : lower("${team}:${repository}") => {
172168
repository = repository
173-
team_id = github_team.this[lower(team)].id
169+
team_key = lower(team)
174170
permission = permission
175171
}
176172
}
@@ -182,7 +178,7 @@ resource "github_team_repository" "this" {
182178
]
183179

184180
repository = each.value.repository
185-
team_id = each.value.team_id
181+
team_id = github_team.this[each.value.team_key].id
186182

187183
permission = try(each.value.permission, null)
188184

@@ -197,15 +193,15 @@ resource "github_team_membership" "this" {
197193
[
198194
for role, members in lookup(team_config, "members", {}) : {
199195
for member in members : lower("${team}:${member}") => {
200-
team_id = github_team.this[lower(team)].id
196+
team_key = lower(team)
201197
username = member
202198
role = role
203199
}
204200
}
205201
]
206202
])...)
207203

208-
team_id = each.value.team_id
204+
team_id = github_team.this[each.value.team_key].id
209205
username = each.value.username
210206
role = each.value.role
211207

@@ -221,9 +217,9 @@ resource "github_repository_file" "this" {
221217
for config in [
222218
for file, config in lookup(repository_config, "files", {}) : merge(config, {
223219
repository = repository
224-
file = file
225-
branch = github_repository.this[lower(repository)].default_branch
226-
content = try(file("${path.module}/../files/${config.content}"), config.content)
220+
file = file
221+
repository_key = lower(repository)
222+
content = try(file("${path.module}/../files/${config.content}"), config.content)
227223
}) if contains(keys(config), "content")
228224
] : lower("${config.repository}/${config.file}") => config
229225
}
@@ -232,7 +228,7 @@ resource "github_repository_file" "this" {
232228
repository = each.value.repository
233229
file = each.value.file
234230
content = each.value.content
235-
branch = each.value.branch
231+
branch = github_repository.this[each.value.repository_key].default_branch
236232
overwrite_on_create = try(each.value.overwrite_on_create, null)
237233
commit_message = "chore: Update ${each.value.file} [skip ci]"
238234

terraform/terraform.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ terraform {
66
}
77
}
88

9-
required_version = "~> 1.1.4"
9+
required_version = "~> 1.3.7"
1010
}

0 commit comments

Comments
 (0)