This feature provides a centralized approach to managing the Safe-Settings Admin Repo, allowing Safe-Settings configurations to be sync'd across multiple ORGs.
This feature adds a hub‑and‑spoke synchronization capability to Safe Settings.
One central master admin repository (the hub) serves as the authoritative source of configuration which is automatically propagated to each organization’s admin repository (the spokes).
Note: When something changes in the central repo, only those changed files are copied to each affected ORG’s admin repo, so everything stays in sync with little manual work.
graph TD
A0(PR Closed) --> A1(HUB Admin Repo)
A1(ORG Admin Repo) --> B(ORG Admin Repo)
A1(HUB Admin Repo) --> C(ORG Admin Repo)
A1(HUB Admin Repo) --> D(ORG Admin Repo)
Environment variables specific to the 'Sync-Feature'
| Name | Purpose | Default |
|---|---|---|
SAFE_SETTINGS_HUB_REPO |
Repo for master safe-settings contents | admin-master |
SAFE_SETTINGS_HUB_ORG |
Organization that hold the Repo | admin-master-org |
SAFE_SETTINGS_HUB_PATH |
source folder | .github/safe-settings |
SAFE_SETTINGS_HUB_DIRECT_PUSH |
Use a PR or direct commit | false |
-
Sync the
Hub Admin Repochanges to aSafe-Settings Admin Repoin the same ORG as the Hub Admin Repo. -
Sync the
Hub Admin changesto aSafe-Settings Admin Repoin a different ORG. -
'Global'Hub Admin Repoupdates. Changes willapplied to all Organization
The following table summarizes the Safe Settings API endpoints:
| Endpoint | Method | Purpose | Example Usage |
|---|---|---|---|
/api/safe-settings/installation |
GET | Organization installation, repo, and sync status | Fetch org status |
/api/safe-settings/hub/content |
GET | List hub repo files/directories | List hub files |
/api/safe-settings/hub/content/* |
GET | Fetch specific file or directory from hub repo | Get file content |
/api/safe-settings/hub/import |
POST | Import settings from orgs into the hub | Import org settings |
/api/safe-settings/env |
GET | App environment/config variables | Get env vars |
Examples:
- Fetch org installation status:
GET /api/safe-settings/installation
- Import settings from orgs:
POST /api/safe-settings/hub/import Body: { "orgs": ["org1", "org2"] }
- List hub repo files:
GET /api/safe-settings/hub/content?ref=main&recursive=true
- Get environment variables:
GET /api/safe-settings/env