Skip to content

Commit 4e90366

Browse files
committed
Bump integrations/github to v6
Remove use of deprecated github_repository attributes: - default_branch - has_downloads - private Change push_restrictions to restrict_pushes.
1 parent b8f8513 commit 4e90366

File tree

4 files changed

+88
-57
lines changed

4 files changed

+88
-57
lines changed

.github/workflows/terraform-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Terraform Init
3636
id: init
37-
run: terraform init
37+
run: terraform init -upgrade
3838

3939
- name: Terraform Validate
4040
id: validate

terraform/github/branches.tf

Lines changed: 85 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ resource "github_branch_protection" "ansible_branch_protection" {
1818
# being able to merge. Also this should prevent outsiders from pushing to the protected branch,
1919
# however, whilst they can open a pull request they shoud not be able to merge that would be
2020
# upto the reviewers or codeowners.
21-
push_restrictions = [
22-
resource.github_team.organisation_teams["Developers"].node_id
23-
]
21+
restrict_pushes {
22+
push_allowances = [
23+
resource.github_team.organisation_teams["Developers"].node_id
24+
]
25+
}
2426

2527
required_status_checks {
2628
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -47,9 +49,11 @@ resource "github_branch_protection" "batch_branch_protection" {
4749
required_approving_review_count = 1
4850
}
4951

50-
push_restrictions = [
51-
resource.github_team.organisation_teams["Developers"].node_id
52-
]
52+
restrict_pushes {
53+
push_allowances = [
54+
resource.github_team.organisation_teams["Developers"].node_id
55+
]
56+
}
5357

5458
required_status_checks {
5559
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -80,9 +84,11 @@ resource "github_branch_protection" "kayobe_branch_protection_py_3-6" {
8084
required_approving_review_count = 1
8185
}
8286

83-
push_restrictions = [
84-
resource.github_team.organisation_teams["Developers"].node_id
85-
]
87+
restrict_pushes {
88+
push_allowances = [
89+
resource.github_team.organisation_teams["Developers"].node_id
90+
]
91+
}
8692

8793
required_status_checks {
8894
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/[vwxy]*", lookup(var.required_status_checks, each.key, {
@@ -114,9 +120,11 @@ resource "github_branch_protection" "kayobe_branch_protection_zed" {
114120
required_approving_review_count = 1
115121
}
116122

117-
push_restrictions = [
118-
resource.github_team.organisation_teams["Developers"].node_id
119-
]
123+
restrict_pushes {
124+
push_allowances = [
125+
resource.github_team.organisation_teams["Developers"].node_id
126+
]
127+
}
120128

121129
required_status_checks {
122130
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/zed", lookup(var.required_status_checks, each.key, {
@@ -149,9 +157,11 @@ resource "github_branch_protection" "kayobe_branch_protection_antelope" {
149157
required_approving_review_count = 1
150158
}
151159

152-
push_restrictions = [
153-
resource.github_team.organisation_teams["Developers"].node_id
154-
]
160+
restrict_pushes {
161+
push_allowances = [
162+
resource.github_team.organisation_teams["Developers"].node_id
163+
]
164+
}
155165

156166
required_status_checks {
157167
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2023.1", lookup(var.required_status_checks, each.key, {
@@ -184,9 +194,11 @@ resource "github_branch_protection" "kayobe_branch_protection_caracal" {
184194
required_approving_review_count = 1
185195
}
186196

187-
push_restrictions = [
188-
resource.github_team.organisation_teams["Developers"].node_id
189-
]
197+
restrict_pushes {
198+
push_allowances = [
199+
resource.github_team.organisation_teams["Developers"].node_id
200+
]
201+
}
190202

191203
required_status_checks {
192204
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2024.1", lookup(var.required_status_checks, each.key, {
@@ -218,9 +230,11 @@ resource "github_branch_protection" "kayobe_branch_protection_epoxy" {
218230
required_approving_review_count = 1
219231
}
220232

221-
push_restrictions = [
222-
resource.github_team.organisation_teams["Developers"].node_id
223-
]
233+
restrict_pushes {
234+
push_allowances = [
235+
resource.github_team.organisation_teams["Developers"].node_id
236+
]
237+
}
224238

225239
required_status_checks {
226240
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/2025.1", lookup(var.required_status_checks, each.key, {
@@ -254,9 +268,11 @@ resource "github_branch_protection" "kayobe_branch_protection_master" {
254268
required_approving_review_count = 1
255269
}
256270

257-
push_restrictions = [
258-
resource.github_team.organisation_teams["Developers"].node_id
259-
]
271+
restrict_pushes {
272+
push_allowances = [
273+
resource.github_team.organisation_teams["Developers"].node_id
274+
]
275+
}
260276

261277
required_status_checks {
262278
contexts = lookup(lookup(var.required_status_checks, each.key, {}), "stackhpc/master", lookup(var.required_status_checks, each.key, {
@@ -286,9 +302,11 @@ resource "github_branch_protection" "openstack_branch_protection_py_3-6" {
286302
allows_deletions = false
287303
allows_force_pushes = false
288304

289-
push_restrictions = [
290-
resource.github_team.organisation_teams["Developers"].node_id
291-
]
305+
restrict_pushes {
306+
push_allowances = [
307+
resource.github_team.organisation_teams["Developers"].node_id
308+
]
309+
}
292310

293311
required_pull_request_reviews {
294312
dismiss_stale_reviews = true
@@ -319,9 +337,11 @@ resource "github_branch_protection" "openstack_branch_protection_zed" {
319337
allows_deletions = false
320338
allows_force_pushes = false
321339

322-
push_restrictions = [
323-
resource.github_team.organisation_teams["Developers"].node_id
324-
]
340+
restrict_pushes {
341+
push_allowances = [
342+
resource.github_team.organisation_teams["Developers"].node_id
343+
]
344+
}
325345

326346
required_pull_request_reviews {
327347
dismiss_stale_reviews = true
@@ -354,9 +374,11 @@ resource "github_branch_protection" "openstack_branch_protection_antelope" {
354374
allows_deletions = false
355375
allows_force_pushes = false
356376

357-
push_restrictions = [
358-
resource.github_team.organisation_teams["Developers"].node_id
359-
]
377+
restrict_pushes {
378+
push_allowances = [
379+
resource.github_team.organisation_teams["Developers"].node_id
380+
]
381+
}
360382

361383
required_pull_request_reviews {
362384
dismiss_stale_reviews = true
@@ -389,9 +411,11 @@ resource "github_branch_protection" "openstack_branch_protection_caracal" {
389411
allows_deletions = false
390412
allows_force_pushes = false
391413

392-
push_restrictions = [
393-
resource.github_team.organisation_teams["Developers"].node_id
394-
]
414+
restrict_pushes {
415+
push_allowances = [
416+
resource.github_team.organisation_teams["Developers"].node_id
417+
]
418+
}
395419

396420
required_pull_request_reviews {
397421
dismiss_stale_reviews = true
@@ -423,9 +447,11 @@ resource "github_branch_protection" "openstack_branch_protection_epoxy" {
423447
allows_deletions = false
424448
allows_force_pushes = false
425449

426-
push_restrictions = [
427-
resource.github_team.organisation_teams["Developers"].node_id
428-
]
450+
restrict_pushes {
451+
push_allowances = [
452+
resource.github_team.organisation_teams["Developers"].node_id
453+
]
454+
}
429455

430456
required_pull_request_reviews {
431457
dismiss_stale_reviews = true
@@ -458,9 +484,11 @@ resource "github_branch_protection" "openstack_branch_protection_master" {
458484
allows_deletions = false
459485
allows_force_pushes = false
460486

461-
push_restrictions = [
462-
resource.github_team.organisation_teams["Developers"].node_id
463-
]
487+
restrict_pushes {
488+
push_allowances = [
489+
resource.github_team.organisation_teams["Developers"].node_id
490+
]
491+
}
464492

465493
required_pull_request_reviews {
466494
dismiss_stale_reviews = true
@@ -499,9 +527,11 @@ resource "github_branch_protection" "platform_branch_protection" {
499527
required_approving_review_count = 1
500528
}
501529

502-
push_restrictions = [
503-
resource.github_team.organisation_teams["Developers"].node_id
504-
]
530+
restrict_pushes {
531+
push_allowances = [
532+
resource.github_team.organisation_teams["Developers"].node_id
533+
]
534+
}
505535

506536
required_status_checks {
507537
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -528,9 +558,11 @@ resource "github_branch_protection" "releasetrain_branch_protection" {
528558
required_approving_review_count = 1
529559
}
530560

531-
push_restrictions = [
532-
resource.github_team.organisation_teams["Developers"].node_id
533-
]
561+
restrict_pushes {
562+
push_allowances = [
563+
resource.github_team.organisation_teams["Developers"].node_id
564+
]
565+
}
534566

535567
required_status_checks {
536568
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default
@@ -557,9 +589,11 @@ resource "github_branch_protection" "smslab_branch_protection" {
557589
required_approving_review_count = 1
558590
}
559591

560-
push_restrictions = [
561-
resource.github_team.organisation_teams["Developers"].node_id
562-
]
592+
restrict_pushes {
593+
push_allowances = [
594+
resource.github_team.organisation_teams["Developers"].node_id
595+
]
596+
}
563597

564598
required_status_checks {
565599
contexts = lookup(var.required_status_checks, each.key, { "default" : [] }).default

terraform/github/provider.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
github = {
44
source = "integrations/github"
5-
version = "4.28.0"
5+
version = "6.11.1"
66
}
77
}
88
cloud {
@@ -27,4 +27,4 @@ provider "github" {
2727
# provider "github" {
2828
# owner = var.owner
2929
# token = var.GITHUB_TOKEN
30-
# }
30+
# }

terraform/github/repositories.tf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ resource "github_repository" "repositories" {
1010
ignore_changes = [
1111
description,
1212
homepage_url,
13-
private,
1413
visibility,
1514
has_issues,
1615
has_projects,
1716
has_wiki,
1817
is_template,
19-
has_downloads,
2018
auto_init,
2119
gitignore_template,
2220
license_template,
23-
default_branch,
2421
archived,
2522
archive_on_destroy,
2623
pages,

0 commit comments

Comments
 (0)