Skip to content

Commit 89c415b

Browse files
committed
upgrade@14524846595
1 parent 860f6a1 commit 89c415b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6252
-12414
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "npm"
8+
directory: "/scripts/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/apply.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Checkout
6868
uses: actions/checkout@v4
6969
- name: Setup terraform
70-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
70+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
7171
with:
7272
terraform_version: 1.2.9
7373
terraform_wrapper: false

.github/workflows/clean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Checkout
7272
uses: actions/checkout@v4
7373
- name: Setup terraform
74-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
74+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
7575
with:
7676
terraform_version: 1.2.9
7777
terraform_wrapper: false

.github/workflows/fix.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
git fetch origin "pull/${NUMBER}/head"
9494
rm -rf github && git checkout "${SHA}" -- github
9595
- name: Setup terraform
96-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
96+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
9797
with:
9898
terraform_version: 1.2.9
9999
terraform_wrapper: false
@@ -117,7 +117,7 @@ jobs:
117117
# NOTE(galargh, 2024-02-15): This will only work if GitHub as Code is used for a single organization
118118
- name: Comment on pull request
119119
if: github.event_name == 'pull_request_target' && steps.fix.outputs.comment
120-
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
120+
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
121121
with:
122122
header: fix
123123
number: ${{ github.event.pull_request.number }}
@@ -135,10 +135,11 @@ jobs:
135135
steps:
136136
- name: Generate app token
137137
id: token
138-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
138+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
139139
with:
140140
app_id: ${{ secrets.RW_GITHUB_APP_ID }}
141-
installation_id: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}
141+
installation_retrieval_mode: id
142+
installation_retrieval_payload: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}
142143
private_key: ${{ secrets.RW_GITHUB_APP_PEM_FILE }}
143144
- name: Checkout
144145
uses: actions/checkout@v4

.github/workflows/plan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
git fetch origin "pull/${NUMBER}/head"
8181
rm -rf github && git checkout "${SHA}" -- github
8282
- name: Setup terraform
83-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
83+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
8484
with:
8585
terraform_version: 1.2.9
8686
terraform_wrapper: false
@@ -122,7 +122,7 @@ jobs:
122122
git fetch origin "pull/${NUMBER}/head"
123123
rm -rf github && git checkout "${SHA}" -- github
124124
- name: Setup terraform
125-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
125+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
126126
with:
127127
terraform_version: 1.2.9
128128
terraform_wrapper: false
@@ -157,7 +157,7 @@ jobs:
157157
echo 'EOF' >> $GITHUB_ENV
158158
working-directory: terraform
159159
- name: Comment on pull request
160-
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
160+
uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
161161
with:
162162
header: plan
163163
number: ${{ github.event.pull_request.number }}

.github/workflows/sync.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Checkout
6666
uses: actions/checkout@v4
6767
- name: Setup terraform
68-
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
68+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
6969
with:
7070
terraform_version: 1.2.9
7171
terraform_wrapper: false
@@ -107,10 +107,11 @@ jobs:
107107
steps:
108108
- name: Generate app token
109109
id: token
110-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
110+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
111111
with:
112112
app_id: ${{ secrets.RW_GITHUB_APP_ID }}
113-
installation_id: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}
113+
installation_retrieval_mode: id
114+
installation_retrieval_payload: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}
114115
private_key: ${{ secrets.RW_GITHUB_APP_PEM_FILE }}
115116
- name: Checkout
116117
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88
### Added
9+
- shared action for adding a collaborator to all repositories
910
- clean workflow which removes resources from state
1011
- information on how to handle private GitHub Management repository
1112
- warning about GitHub Management repository access
@@ -22,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2223
- new args for repositories and branch protection rules
2324

2425
### Changed
26+
- **BREAKING**: turned scripts into an ESM project (please ensure you remove the following files during the upgrade: `scripts/.eslintignore`, `scripts/.eslintrc.json`, `scripts/jest.config.js`, `jest.d.ts`, `jest.setup.ts`; please update your imports in the `scripts/src/actions/fix-yaml-config.ts` file to include the `.js` extension)
27+
- **BREAKING**: Updated the signatures of all the shared actions; now the runAction function will persist the changes to disk while action functions will operate on the in-memory state (please update your imports in the `scripts/src/actions/fix-yaml-config.ts` file accordingly)
2528
- Synchronization script: to use GitHub API directly instead of relying on TF GH Provider's Data Sources
2629
- Configuration: replaced multiple JSONs with a single, unified YAML
2730
- Synchronization script: rewrote the script in JS
@@ -46,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4649
- updated upload and download artifacts actions to v4
4750

4851
### Fixed
52+
- fixed how terraform state is accessed before it the initial synchronization
4953
- links to supported resources in HOWTOs
5054
- posting PR comments when terraform plan output is very long
5155
- PR parsing in the update workflow

docs/HOWTOS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ I want to ensure that all the public repositories in my organization have their
118118
To do that, I ensure the following content is present in `scripts/src/actions/fix-yaml-config.ts`:
119119
```ts
120120
import 'reflect-metadata'
121-
import { protectDefaultBranches } from './shared/protect-default-branches'
121+
import { runProtectDefaultBranches } from './shared/protect-default-branches'
122122
123-
protectDefaultBranches()
123+
runProtectDefaultBranches()
124124
```

docs/SETUP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
- [ ] Rename the `$GITHUB_ORGANIZATION_NAME.yml` in `github` to the name of the GitHub organization
144144
- [ ] Push the changes to `$GITHUB_MGMT_REPOSITORY_DEFAULT_BRANCH`
145145
146+
> [!WARNING] Please note that until you [synchronize GitHub Management with GitHub](#github-management-sync-flow) for the first time, the workflows that depend on Terraform state, like `Fix`, `Plan` or `Apply`, will fail. This is because the state is not yet initialized.
147+
146148
## GitHub Management Sync Flow
147149
148150
- [ ] Follow [How to synchronize GitHub Management with GitHub?](HOWTOS.md#synchronize-github-management-with-github) to commit the terraform lock and initialize terraform state

github/.schema.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"additionalProperties": {
2828
"additionalProperties": false,
2929
"properties": {
30+
"advanced_security": {
31+
"type": "boolean"
32+
},
3033
"allow_auto_merge": {
3134
"type": "boolean"
3235
},
@@ -39,6 +42,9 @@
3942
"allow_squash_merge": {
4043
"type": "boolean"
4144
},
45+
"allow_update_branch": {
46+
"type": "boolean"
47+
},
4248
"archive_on_destroy": {
4349
"type": "boolean"
4450
},
@@ -108,6 +114,9 @@
108114
"gitignore_template": {
109115
"type": "string"
110116
},
117+
"has_discussions": {
118+
"type": "boolean"
119+
},
111120
"has_downloads": {
112121
"type": "boolean"
113122
},
@@ -129,9 +138,21 @@
129138
"is_template": {
130139
"type": "boolean"
131140
},
141+
"labels": {
142+
"additionalProperties": {
143+
"$ref": "#/definitions/RepositoryLabel"
144+
},
145+
"type": "object"
146+
},
132147
"license_template": {
133148
"type": "string"
134149
},
150+
"merge_commit_message": {
151+
"type": "string"
152+
},
153+
"merge_commit_title": {
154+
"type": "string"
155+
},
135156
"pages": {
136157
"additionalProperties": false,
137158
"properties": {
@@ -153,6 +174,18 @@
153174
},
154175
"type": "object"
155176
},
177+
"secret_scanning": {
178+
"type": "boolean"
179+
},
180+
"secret_scanning_push_protection": {
181+
"type": "boolean"
182+
},
183+
"squash_merge_commit_message": {
184+
"type": "string"
185+
},
186+
"squash_merge_commit_title": {
187+
"type": "string"
188+
},
156189
"teams": {
157190
"additionalProperties": false,
158191
"properties": {
@@ -276,9 +309,15 @@
276309
"allows_force_pushes": {
277310
"type": "boolean"
278311
},
312+
"blocks_creations": {
313+
"type": "boolean"
314+
},
279315
"enforce_admins": {
280316
"type": "boolean"
281317
},
318+
"lock_branch": {
319+
"type": "boolean"
320+
},
282321
"push_restrictions": {
283322
"items": {
284323
"type": "string"
@@ -354,6 +393,18 @@
354393
},
355394
"type": "object"
356395
},
396+
"RepositoryLabel": {
397+
"additionalProperties": false,
398+
"properties": {
399+
"color": {
400+
"type": "string"
401+
},
402+
"description": {
403+
"type": "string"
404+
}
405+
},
406+
"type": "object"
407+
},
357408
"Visibility": {
358409
"enum": [
359410
"private",

0 commit comments

Comments
 (0)