@aspruyt/xfg
v6.1.0
Published
Manage files, settings, and repositories across GitHub, Azure DevOps, and GitLab — declaratively, from a single YAML config
Maintainers
Readme
xfg
Manage files, settings, and repositories across GitHub, Azure DevOps, and GitLab — declaratively, from a single YAML config.
Define your organization's standards once. xfg creates PRs to sync config files, applies repository settings and rulesets via API, and can even create, fork, or migrate repositories — all from one config file.
Quick Start
GitHub Action
# .github/workflows/sync-configs.yml
name: Sync Configs
on:
push:
branches: [main]
paths: [sync-config.yaml]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthony-spruyt/xfg@v5
with:
config: ./sync-config.yaml
github-token: ${{ secrets.GH_PAT }} # PAT with repo scope for cross-repo accessCLI
# Install
npm install -g @aspruyt/xfg
# Authenticate (GitHub)
gh auth login
# Sync files, settings, rulesets, and labels across repos
xfg sync --config ./config.yamlExample Config
# sync-config.yaml
id: my-org-standards
files:
.prettierrc.json:
content:
semi: false
singleQuote: true
tabWidth: 2
settings:
repo:
allowSquashMerge: true
deleteBranchOnMerge: true
vulnerabilityAlerts: true
secretScanning: true
rulesets:
main-protection:
target: branch
enforcement: active
conditions:
refName:
include: [refs/heads/main]
exclude: []
rules:
- type: pull_request
parameters:
requiredApprovingReviewCount: 1
- type: required_status_checks
parameters:
requiredStatusChecks:
- context: "ci/build"
repos:
- git:
- [email protected]:your-org/frontend-app.git
- [email protected]:your-org/backend-api.gitResult: PRs are created with .prettierrc.json files, and repos get standardized merge options, security settings, and branch protection rulesets.
Documentation
See anthony-spruyt.github.io/xfg for the full feature list, configuration reference, examples, platform setup, and troubleshooting.
