Skip to content

Commit 372895b

Browse files
authored
Merge pull request #225 from ipfs/master-upgrade
upgrade@14524845473
2 parents 246e3a3 + f992e45 commit 372895b

Some content is hidden

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

64 files changed

+6224
-12586
lines changed

.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

scripts/.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

scripts/.eslintrc.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)