Repo management¶
Org-wide automation that keeps the ~28 AzureLocal repos in sync with the platform canon.
What lives here¶
| Page | Script(s) |
|---|---|
| Overview | High-level map of the automation set |
| New-repo bootstrap | New-AzureLocalRepo.ps1 — create a new repo end-to-end |
| Drift audit | Invoke-RepoAudit.ps1 — monthly org-wide conformance report |
| Label sync | Sync-Labels.ps1 — apply canonical 16-label set |
| Branch protection | Sync-BranchProtection.ps1 — apply canonical rules |
| Common file sync | Sync-CommonFiles.ps1 — propagate LICENSE, .editorconfig, .gitignore |
| Emergency runbooks | What to do when something goes wrong org-wide |
Script location¶
All scripts are under repo-management/org-scripts/ in the platform repo. All depend on AzureLocal.Common for logging, inventory, and conformance checks.
Invocation model¶
Scripts are designed to:
- Default to dry-run / report-only when run without mutating flags.
- Accept
-Repo <name>to operate against a single repo, or no-Repoto operate against every non-archived AzureLocal repo. - Use
Write-AzureLocalLogfor colored, level-tagged output. - Emit JSON when
-OutputPathis given (for CI consumption bydrift-audit.yml).
Prerequisites¶
ghCLI authenticated withrepoandadmin:orgscopes- PowerShell 7.2+
- Platform repo cloned and
AzureLocal.Commonimportable
Read before running destructive scripts¶
- Sync-Labels — additive, not destructive
- Sync-BranchProtection — overwrites existing protection; dry-run first
- Sync-CommonFiles — opens PRs; dry-run first
- New-AzureLocalRepo — creates GitHub resources; dry-run first