Skip to content

Commit 4d6f564

Browse files
Merge branch 'master' into js-multiformats-codeowners
2 parents 46b9282 + 94bd026 commit 4d6f564

File tree

19 files changed

+578
-972
lines changed

19 files changed

+578
-972
lines changed

.github/actions/git-config-user/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ description: Configure git user
44
runs:
55
using: composite
66
steps:
7-
- run: |
7+
- if: github.event_name == 'workflow_dispatch'
8+
run: |
89
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com>"
910
git config --global user.name "${GITHUB_ACTOR}"
1011
shell: bash
12+
- if: github.event_name != 'workflow_dispatch'
13+
run: |
14+
git config --global user.name "github-actions[bot]"
15+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
16+
shell: bash

.github/workflows/apply.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
7171
with:
7272
terraform_version: 1.2.9
73+
terraform_wrapper: false
7374
- name: Initialize terraform
7475
run: terraform init
7576
- name: Terraform Plan Download
@@ -78,4 +79,6 @@ jobs:
7879
SHA: ${{ needs.prepare.outputs.sha }}
7980
run: gh run download -n "${TF_WORKSPACE}_${SHA}.tfplan" --repo "${GITHUB_REPOSITORY}"
8081
- name: Terraform Apply
81-
run: terraform apply -lock-timeout=0s -no-color "${TF_WORKSPACE}.tfplan"
82+
run: |
83+
terraform show -json > $TF_WORKSPACE.tfstate.json
84+
terraform apply -lock-timeout=0s -no-color "${TF_WORKSPACE}.tfplan"

.github/workflows/fix.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ jobs:
9797
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
9898
with:
9999
terraform_version: 1.2.9
100+
terraform_wrapper: false
100101
- name: Initialize terraform
101102
run: terraform init
102103
working-directory: terraform
103104
- name: Initialize scripts
104105
run: npm ci && npm run build
105106
working-directory: scripts
106107
- name: Fix
108+
id: fix
107109
run: node lib/actions/fix-yaml-config.js
108110
working-directory: scripts
109111
- name: Upload YAML config
@@ -113,6 +115,15 @@ jobs:
113115
path: github/${{ env.TF_WORKSPACE }}.yml
114116
if-no-files-found: error
115117
retention-days: 1
118+
# NOTE(galargh, 2024-02-15): This will only work if GitHub as Code is used for a single organization
119+
- name: Comment on pull request
120+
if: github.event_name == 'pull_request_target' && steps.fix.outputs.comment
121+
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
122+
with:
123+
header: fix
124+
number: ${{ github.event.pull_request.number }}
125+
message: ${{ steps.fix.outputs.comment }}
126+
116127
push:
117128
needs: [prepare, fix]
118129
permissions:

.github/workflows/plan.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,14 @@ jobs:
8383
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
8484
with:
8585
terraform_version: 1.2.9
86+
terraform_wrapper: false
8687
- name: Initialize terraform
8788
run: terraform init
8889
working-directory: terraform
8990
- name: Plan terraform
90-
run: terraform plan -refresh=false -lock=false -out="${TF_WORKSPACE}.tfplan" -no-color
91+
run: |
92+
terraform show -json > $TF_WORKSPACE.tfstate.json
93+
terraform plan -refresh=false -lock=false -out="${TF_WORKSPACE}.tfplan" -no-color
9194
working-directory: terraform
9295
- name: Upload terraform plan
9396
uses: actions/upload-artifact@v3
@@ -156,6 +159,7 @@ jobs:
156159
- name: Comment on pull request
157160
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # v2.3.1
158161
with:
162+
header: plan
159163
number: ${{ github.event.pull_request.number }}
160164
message: |
161165
Before merge, verify that all the following plans are correct. They will be applied as-is after the merge.

.github/workflows/upgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
upgrade:
13-
uses: protocol/github-mgmt-template/.github/workflows/upgrade_reusable.yml@master
13+
uses: pl-strflt/github-mgmt-template/.github/workflows/upgrade_reusable.yml@master
1414
with:
1515
ref: inputs.ref
1616
secrets:

docs/EXAMPLE.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repositories: # This group defines repositories (https://registry.terraform.io/p
7474
default_branch: master
7575
delete_branch_on_merge: false
7676
description: GitHub Management
77-
homepage_url: https://github.com/protocol/github-mgmt-template
77+
homepage_url: https://github.com/pl-strflt/github-mgmt-template
7878
is_template: false
7979
vulnerability_alerts: false
8080
archive_on_destroy: true
@@ -87,7 +87,7 @@ repositories: # This group defines repositories (https://registry.terraform.io/p
8787
branch: master
8888
path: /docs
8989
template:
90-
owner: protocol
90+
owner: pl-strflt
9191
repository: github-mgmt-template
9292
topics:
9393
- github

docs/HOWTOS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
*Example*
1313

14-
I want to invite `galargh` as an admin to `protocol` organization through GitHub Management.
14+
I want to invite `galargh` as an admin to `pl-strflt` organization through GitHub Management.
1515

1616
I ensure the YAML configuration file has the following entry:
1717
```yaml
@@ -29,7 +29,7 @@ I push my changes to a new branch and create a PR. An admin reviews the PR and m
2929
3030
*Example*
3131
32-
I want to demote `galargh` from being an `admin` of `protocol` organization to a regular `member` through GitHub Management.
32+
I want to demote `galargh` from being an `admin` of `pl-strflt` organization to a regular `member` through GitHub Management.
3333

3434
I change the entry for `galargh` in the YAML configuration file from:
3535
```yaml
@@ -54,7 +54,7 @@ I push my changes to a new branch and create a PR. An admin reviews the PR and m
5454

5555
*Example*
5656

57-
I want to be able to configure who the member of the `protocol` organization is through GitHub Management.
57+
I want to be able to configure who the member of the `pl-strflt` organization is through GitHub Management.
5858

5959
I add `github_membership` to `resource_types` array in [terraform/locals_override.tf](../terraform/locals_override.tf). I push my changes to a new branch and create a PR. An admin reviews the PR and merges the PR if everything looks OK. Then, they synchronize GitHub Management with GitHub configuration.
6060

@@ -67,7 +67,7 @@ I add `github_membership` to `resource_types` array in [terraform/locals_overrid
6767

6868
*Example*
6969

70-
I do not want to configure the roles of `protocol` organization members through GitHub Management anymore.
70+
I do not want to configure the roles of `pl-strflt` organization members through GitHub Management anymore.
7171

7272
I ensure that `terraform/resources_override.tf` contains the following entry:
7373
```tf

0 commit comments

Comments
 (0)