You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Scripts use environment variables for configuration. Common variables include:
80
80
|`GITHUB_TOKEN`| GitHub personal access token | Yes |
81
81
|`ORG`| Organization name | Yes (most scripts) |
82
82
|`API_URL_PREFIX`| GitHub API base URL (default: `https://api.github.com`) | No |
83
-
|`GIT_URL_PREFIX`| GitHub base URL (default: `https://github.com`) | No |
83
+
|`GIT_URL_PREFIX`| GitHub base URL (default: `https://github.com`). Must be a GitHub-family host (`github.com`, `*.github.com`, `*.ghe.com`, `*.githubenterprise.com`).| No |
84
84
85
85
> [!NOTE]
86
86
> The `*_PREFIX` variables support GitHub Enterprise Server. Set them to your enterprise domain to use these scripts with GHES.
@@ -200,6 +200,9 @@ cd org-admin/github-repo-from-template
200
200
- Assigns write permissions to teams in `REPO_WRITE`
201
201
- Invites CD user as collaborator and auto-accepts the invitation
202
202
203
+
> [!NOTE]
204
+
> `REPO_NAME` (CLI argument), `TEMPLATE_REPO`, `CD_USERNAME`, and all team slugs in `REPO_ADMIN` and `REPO_WRITE` are validated as slugs before use. Only alphanumeric characters, hyphens, and underscores are accepted.
205
+
203
206
---
204
207
205
208
### Import Repository
@@ -231,6 +234,9 @@ cd org-admin/github-import-repo
231
234
> [!WARNING]
232
235
> This creates a complete copy with full git history. Ensure you have sufficient disk space and network bandwidth for large repositories.
233
236
237
+
> [!NOTE]
238
+
> `GIT_URL_PREFIX` is validated against a GitHub-host allowlist before any git operations run. Non-GitHub URLs are rejected to prevent credential leakage. Repository names and `OWNER_USERNAME` must be valid slugs (alphanumeric, hyphen, and underscore only).
239
+
234
240
---
235
241
236
242
### Add Repository Collaborators by Pattern
@@ -331,6 +337,9 @@ cd org-admin/github-auto-repo-creation
331
337
> [!NOTE]
332
338
> Requires `base64` in addition to `curl` and `jq` (used to encode the CODEOWNERS file content for the API).
333
339
340
+
> [!NOTE]
341
+
> All values in `REPO_NAMES`, `ADMIN_TEAMS`, and `REPO_OWNERS` are validated as slugs — only alphanumeric characters, hyphens, and underscores are allowed. The script exits with an error if any value fails this check.
342
+
334
343
---
335
344
336
345
### Close Archived Repository Security Alerts
@@ -691,6 +700,9 @@ cd enterprise/github-dockerfile-discovery
691
700
> [!NOTE]
692
701
> Code search is heavily rate-limited. Increase `SEARCH_SLEEP` and `CONTENT_SLEEP` if you encounter `403` responses.
693
702
703
+
> [!NOTE]
704
+
> `ORG_FILTER` and `ORG_EXCLUDE` are validated as syntactically correct ERE patterns before use. An invalid regex causes the script to exit immediately with an error rather than silently bypassing the filter.
705
+
694
706
---
695
707
696
708
### Get Public Repositories
@@ -724,6 +736,9 @@ cd enterprise/github-get-public-repos
724
736
|`ORG_FILTER`| ERE regex to keep only matching org names | — |
725
737
|`ORG_EXCLUDE`| ERE regex to drop matching org names | — |
726
738
739
+
> [!NOTE]
740
+
> `ORG_FILTER` and `ORG_EXCLUDE` are validated as syntactically correct ERE patterns before use. An invalid regex causes the script to exit immediately with an error rather than silently bypassing the filter.
0 commit comments