GeezerVison is showing github.com — Update GitHub Management as Code · probe-lab/github-mgmt@5160def
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/actions/git-config-user/action.yml +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,12 @@ description: Configure git user | 4 | 4 | runs: | 5 | 5 | using: composite | 6 | 6 | steps: | 7 | | - - run: | | | 7 | + - if: github.event_name == 'workflow_dispatch' | | 8 | + run: | | 8 | 9 | git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com>" | 9 | 10 | git config --global user.name "${GITHUB_ACTOR}" | 10 | 11 | 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" |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/upgrade.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 10 | 10 |
| 11 | 11 | jobs: | 12 | 12 | 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 | 14 | 14 | with: | 15 | 15 | ref: inputs.ref | 16 | 16 | secrets: | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/upgrade_reusable.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 34 | 34 | - name: Checkout GitHub Management template | 35 | 35 | uses: actions/checkout@v3 | 36 | 36 | with: | 37 | | - repository: protocol/github-mgmt-template | | 37 | + repository: pl-strflt/github-mgmt-template | 38 | 38 | path: github-mgmt-template | 39 | 39 | ref: ${{ github.event.inputs.ref }} | 40 | 40 | - name: Checkout GitHub Management | |
Collapse file Copy file name to clipboard +20-7Lines changed: 20 additions & 7 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -# GitHub Management via Terraform: Template | | 1 | +<div align="center"> | 2 | 2 |
| 3 | | -This repository is meant to serve as a template for creating new repositories responsible for managing GitHub configuration as code with Terraform. It provides an opinionated way to manage GitHub configuration without following the Terraform usage guidelines to the letter. It was designed with managing multiple, medium to large sized GitHub organisations in mind and that is exactly what it is/is going to be optimised for. | | 3 | + | 4 | 4 |
| 5 | | -**IMPORTANT**: Having write access to GitHub Management repository can be as powerful as having admin access to the organizations managed by that repository. | | 5 | +# GitHub Management as Code | 6 | 6 |
| 7 | | -To learn more, check out: | 8 | | -- [What is GitHub Management and how does it work?](docs/ABOUT.md) | 9 | | -- [How to set up GitHub Management?](docs/SETUP.md) | 10 | | -- [How to work with GitHub Management?](docs/HOWTOS.md) | | 7 | +A robust template for managing GitHub configurations as code via Pull Requests. Designed with the effective administration of multiple medium to large-sized GitHub organizations in mind. | | 8 | + | | 9 | +</div> | | 10 | + | | 11 | +## Importance of Access Control | | 12 | + | | 13 | +**NOTE**: Possessing write access to the GitHub Management repository can equate to having administrative privileges over the organizations managed by that repository. Please exercise caution and ensure proper access control measures. | | 14 | + | | 15 | +## Dive Deeper | | 16 | + | | 17 | +- Learn more about [what GitHub Management is and how it works](docs/ABOUT.md). | | 18 | +- Get started with [setting up GitHub Management](docs/SETUP.md). | | 19 | +- Uncover [how to effectively utilize GitHub Management](docs/HOWTOS.md). | | 20 | + | | 21 | +## Active Users | | 22 | + | | 23 | +A broad range of diverse organizations are already leveraging our GitHub Management solution via Pull Request Workflow. You can find a comprehensive list of these organizations on our [GitHub Management Router repository](https://github.com/pl-strflt/github-mgmt-router). This list showcases the versatility and effectiveness of our GitHub Management system. Our solution can be tailored to meet your unique requirements, driving efficiency and streamlined GitHub organization management. |
Collapse file Copy file name to clipboardExpand all lines: docs/EXAMPLE.yml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -74,7 +74,7 @@ repositories: # This group defines repositories (https://registry.terraform.io/p | 74 | 74 | default_branch: master | 75 | 75 | delete_branch_on_merge: false | 76 | 76 | description: GitHub Management | 77 | | - homepage_url: https://github.com/protocol/github-mgmt-template | | 77 | + homepage_url: https://github.com/pl-strflt/github-mgmt-template | 78 | 78 | is_template: false | 79 | 79 | vulnerability_alerts: false | 80 | 80 | archive_on_destroy: true | @@ -87,7 +87,7 @@ repositories: # This group defines repositories (https://registry.terraform.io/p | 87 | 87 | branch: master | 88 | 88 | path: /docs | 89 | 89 | template: | 90 | | - owner: protocol | | 90 | + owner: pl-strflt | 91 | 91 | repository: github-mgmt-template | 92 | 92 | topics: | 93 | 93 | - github |
Collapse file Copy file name to clipboardExpand all lines: docs/HOWTOS.md +4-4Lines changed: 4 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 |
| 12 | 12 | *Example* | 13 | 13 |
| 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. | 15 | 15 |
| 16 | 16 | I ensure the YAML configuration file has the following entry: | 17 | 17 | ```yaml | @@ -29,7 +29,7 @@ I push my changes to a new branch and create a PR. An admin reviews the PR and m | 29 | 29 |
| 30 | 30 | *Example* | 31 | 31 |
| 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. | 33 | 33 |
| 34 | 34 | I change the entry for `galargh` in the YAML configuration file from: | 35 | 35 | ```yaml | @@ -54,7 +54,7 @@ I push my changes to a new branch and create a PR. An admin reviews the PR and m | 54 | 54 |
| 55 | 55 | *Example* | 56 | 56 |
| 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. | 58 | 58 |
| 59 | 59 | 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. | 60 | 60 |
| @@ -67,7 +67,7 @@ I add `github_membership` to `resource_types` array in [terraform/locals_overrid | 67 | 67 |
| 68 | 68 | *Example* | 69 | 69 |
| 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. | 71 | 71 |
| 72 | 72 | I ensure that `terraform/resources_override.tf` contains the following entry: | 73 | 73 | ```tf | |
Collapse file Copy file name to clipboardExpand all lines: scripts/__tests__/__resources__/files/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | # GitHub Management via Terraform: pl-strflt | 2 | 2 |
| 3 | | -This repository is responsible for managing GitHub configuration of `pl-strflt` organisation as code with Terraform. It was created from [github-mgmt-template](https://github.com/protocol/github-mgmt-template) and it will receive updates from that repository. | | 3 | +This repository is responsible for managing GitHub configuration of `pl-strflt` organisation as code with Terraform. It was created from [github-mgmt-template](https://github.com/pl-strflt/github-mgmt-template) and it will receive updates from that repository. | 4 | 4 |
| 5 | 5 | **IMPORTANT**: Having write access to GitHub Management repository can be as powerful as having admin access to the organizations managed by that repository. | 6 | 6 |
| |
Collapse file Copy file name to clipboardExpand all lines: scripts/__tests__/__resources__/github/default.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -78,7 +78,7 @@ repositories: | 78 | 78 | triage: | 79 | 79 | - ipdx | 80 | 80 | template: | 81 | | - owner: protocol | | 81 | + owner: pl-strflt | 82 | 82 | repository: github-mgmt-template | 83 | 83 | visibility: public | 84 | 84 | vulnerability_alerts: false | |
Collapse file Copy file name to clipboardExpand all lines: scripts/__tests__/__resources__/terraform/terraform.tfstate +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1409 | 1409 | "svn_url": "https://github.com/pl-strflt/github-mgmt", | 1410 | 1410 | "template": [ | 1411 | 1411 | { | 1412 | | - "owner": "protocol", | | 1412 | + "owner": "pl-strflt", | 1413 | 1413 | "repository": "github-mgmt-template" | 1414 | 1414 | } | 1415 | 1415 | ], | | 1794 | 1794 | | 1795 | 1795 | "commit_message": "Update README", | 1796 | 1796 | "commit_sha": "ff32de62d3dd9bc01a2dabd8439d413e8a250dfe", | 1797 | | - "content": "# GitHub Management via Terraform: pl-strflt\n\nThis repository is responsible for managing GitHub configuration of `pl-strflt` organisation as code with Terraform. It was created from [github-mgmt-template](https://github.com/protocol/github-mgmt-template) and it will receive updates from that repository.\n\n**IMPORTANT**: Having write access to GitHub Management repository can be as powerful as having admin access to the organizations managed by that repository.\n\n*NOTE*: Because we don't have merge queue functionality enabled for the repository yet, after a merge, wait for the `Apply` and `Update` workflows to complete before merging any other PRs.\n\nTo learn more, check out:\n- [What is GitHub Management and how does it work?](docs/ABOUT.md)\n- [How to set up GitHub Management?](docs/SETUP.md)\n- [How to work with GitHub Management?](docs/HOWTOS.md)\n", | | 1797 | + "content": "# GitHub Management via Terraform: pl-strflt\n\nThis repository is responsible for managing GitHub configuration of `pl-strflt` organisation as code with Terraform. It was created from [github-mgmt-template](https://github.com/pl-strflt/github-mgmt-template) and it will receive updates from that repository.\n\n**IMPORTANT**: Having write access to GitHub Management repository can be as powerful as having admin access to the organizations managed by that repository.\n\n*NOTE*: Because we don't have merge queue functionality enabled for the repository yet, after a merge, wait for the `Apply` and `Update` workflows to complete before merging any other PRs.\n\nTo learn more, check out:\n- [What is GitHub Management and how does it work?](docs/ABOUT.md)\n- [How to set up GitHub Management?](docs/SETUP.md)\n- [How to work with GitHub Management?](docs/HOWTOS.md)\n", | 1798 | 1798 | "file": "README.md", | 1799 | 1799 | "id": "github-mgmt/README.md", | 1800 | 1800 | "overwrite_on_create": false, | |
Collapse file Copy file name to clipboardExpand all lines: scripts/src/utils.ts +23Lines changed: 23 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,3 +15,26 @@ export function yamlify(value: any): YAML.ParsedNode { | 15 | 15 | } | 16 | 16 | return node | 17 | 17 | } | | 18 | + | | 19 | +export function globToRegex(globPattern: string): RegExp { | | 20 | + const regexPattern = globPattern | | 21 | + .split('') | | 22 | + .map(char => { | | 23 | + if (char === '*') { | | 24 | + return '.*' | | 25 | + } else if (char === '?') { | | 26 | + return '.' | | 27 | + } else if ( | | 28 | + ['.', '\\', '+', '(', ')', '[', ']', '{', '}', '|', '^', '$'].includes( | | 29 | + char | | 30 | + ) | | 31 | + ) { | | 32 | + return `\\${char}` | | 33 | + } else { | | 34 | + return char | | 35 | + } | | 36 | + }) | | 37 | + .join('') | | 38 | + | | 39 | + return new RegExp(`^${regexPattern}$`) | | 40 | +} |
|