{"id":35365626,"url":"https://github.com/common-repo/common-repo","last_synced_at":"2026-04-15T04:01:43.476Z","repository":{"id":320494884,"uuid":"1080838861","full_name":"common-repo/common-repo","owner":"common-repo","description":"Common-Repo","archived":false,"fork":false,"pushed_at":"2026-04-14T07:59:11.000Z","size":2104,"stargazers_count":2,"open_issues_count":9,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T09:30:00.063Z","etag":null,"topics":["common-repo","git","github","repo","repository","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/common-repo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"shakefu"}},"created_at":"2025-10-22T00:06:26.000Z","updated_at":"2026-04-14T07:59:17.000Z","dependencies_parsed_at":"2025-10-24T05:36:19.136Z","dependency_job_id":"ddbec5d1-3139-49ce-8875-34b3ca3039dc","html_url":"https://github.com/common-repo/common-repo","commit_stats":null,"previous_names":["common-repo/common-repo"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/common-repo/common-repo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-repo%2Fcommon-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-repo%2Fcommon-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-repo%2Fcommon-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-repo%2Fcommon-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/common-repo","download_url":"https://codeload.github.com/common-repo/common-repo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/common-repo%2Fcommon-repo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31825515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-repo","git","github","repo","repository","rust"],"created_at":"2026-01-02T01:53:06.115Z","updated_at":"2026-04-15T04:01:43.465Z","avatar_url":"https://github.com/common-repo.png","language":"Rust","funding_links":["https://github.com/sponsors/shakefu"],"categories":[],"sub_categories":[],"readme":"# common-repo\n\n[![CI](https://github.com/common-repo/common-repo/actions/workflows/ci.yml/badge.svg)](https://github.com/common-repo/common-repo/actions/workflows/ci.yml)\n[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](LICENSE.md)\n[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://common-repo.github.io/common-repo/)\n\nDeclare configuration files as versioned dependencies. Pull from multiple Git repositories, merge structured files at the key level, and track upstream updates with semver.\n\n```yaml\n# .common-repo.yaml\n- repo:\n    url: https://github.com/acme-corp/platform-defaults\n    ref: v2.1.0\n    with:\n      - include: [\".github/**\", \".pre-commit-config.yaml\"]\n\n- repo:\n    url: https://github.com/acme-corp/rust-tooling\n    ref: v1.4.0\n    with:\n      - include: [\"rustfmt.toml\", \"clippy.toml\", \".cargo/**\"]\n\n# Merge CI jobs into an existing workflow instead of replacing it\n- yaml:\n    source: ci-jobs.yml\n    dest: .github/workflows/ci.yml\n    path: jobs\n    append: true\n```\n\n```bash\ncommon-repo diff    # preview changes\ncommon-repo apply   # write files\n```\n\nUpstreams are pinned to git refs and cached locally. The same `.common-repo.yaml` always produces the same output. Upstreams can reference their own upstreams — `common-repo tree` shows the full chain.\n\n## Install\n\n### Shell installer (recommended)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/common-repo/common-repo/main/install.sh | sh\n```\n\nThe installer creates both `common-repo` and the alias `cr`. To skip the alias: `SKIP_ALIAS=1 sh -s \u003c install.sh`\n\n### cargo-binstall (pre-built binary)\n\n```bash\ncargo binstall common-repo\n```\n\n### From source (latest development)\n\n```bash\ncargo install --git https://github.com/common-repo/common-repo\n```\n\n### GitHub Releases\n\nDownload the latest release for your platform from [GitHub Releases](https://github.com/common-repo/common-repo/releases) and add it to your PATH.\n\n### Platform notes\n\n- **Linux/macOS**: Shell installer auto-detects architecture (x86_64, aarch64)\n- **Windows**: Use `cargo install` or download from GitHub Releases\n- **Nix**: `nix run github:common-repo/common-repo` (flake available)\n\n### Minimum Supported Rust Version (MSRV)\n\nThis project supports Rust 1.85.0 and later. MSRV updates are considered non-breaking changes.\n\n## Quick start\n\n```bash\n# Initialize interactively — add repos, auto-detect versions\ncommon-repo init\n\n# Or initialize from an existing repo\ncommon-repo init https://github.com/your-org/shared-configs\ncommon-repo init your-org/shared-configs  # GitHub shorthand\n\n# Add more repos to an existing config\ncommon-repo add your-org/another-repo\n\n# Preview what would change, then apply\ncommon-repo diff\ncommon-repo apply\n```\n\n## Configuration\n\nA `.common-repo.yaml` is a list of operations applied in order:\n\n```yaml\n- repo:\n    url: https://github.com/acme-corp/platform-defaults\n    ref: v2.1.0\n    with:\n      - include: [\".github/**\", \".pre-commit-config.yaml\"]\n      - exclude: [\".github/CODEOWNERS\"]\n      - rename:\n          \".github/workflows/ci.yml\": \".github/workflows/build.yml\"\n```\n\nOperations within `with:` apply only to that upstream's files before merging.\n\n### File merging\n\nMerge operations write into existing files at a specific path instead of replacing them. Supported formats: YAML, JSON, TOML, INI, and Markdown ([full docs](docs/src/configuration.md)).\n\n```yaml\n# Merge into .jobs in an existing workflow\n- yaml:\n    source: ci-jobs.yml\n    dest: .github/workflows/ci.yml\n    path: jobs\n    append: true\n\n# Merge into .scripts in package.json\n- json:\n    source: scripts.json\n    dest: package.json\n    path: scripts\n\n# Merge into [dependencies] in Cargo.toml\n- toml:\n    source: common-deps.toml\n    dest: Cargo.toml\n    path: dependencies\n\n# Merge into a section in .editorconfig\n- ini:\n    source: editor-rules.ini\n    dest: .editorconfig\n    section: \"*\"\n\n# Insert or replace a heading in README.md\n- markdown:\n    source: contributing-section.md\n    dest: README.md\n    section: \"## Contributing\"\n    create-section: true\n```\n\n`auto-merge:` merges files that share the same name on both sides. `defer:` marks merge operations for consumers to inherit.\n\n### Inheritance\n\nUpstreams can have their own `.common-repo.yaml` files referencing other upstreams:\n\n```\nyour-project\n├── acme-corp/platform-defaults v2.1.0\n│   └── common-repo/ci-base v1.0.0\n└── acme-corp/rust-tooling v1.4.0\n    └── common-repo/rust-base v3.2.1\n```\n\nResolution is depth-first post-order: ancestors are applied before their parents, parents before the local repo. Files with the same path are last-write-wins.\n\n### The `self:` operator\n\n`self:` runs an isolated pipeline whose output stays local — it is stripped when other repos inherit from this one:\n\n```yaml\n- self:\n    - repo:\n        url: https://github.com/org/ci-tooling\n        ref: v2.0.0\n- include: [\"src/**\"]  # only this is visible to consumers\n```\n\n## Updates\n\n```bash\ncommon-repo check --updates   # list available updates\ncommon-repo update            # bump compatible versions (minor/patch)\ncommon-repo update --latest   # include breaking changes (major)\n```\n\n### GitHub Actions\n\nAutomate upstream sync with the common-repo action:\n\n```yaml\n# .github/workflows/upstream-sync.yml\nname: Sync Upstream Configuration\n\non:\n  schedule:\n    - cron: '0 9 * * 1'  # Weekly on Monday\n  workflow_dispatch:\n\npermissions:\n  contents: write\n  pull-requests: write\n\njobs:\n  sync:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: common-repo/common-repo@v1\n```\n\nSee [GitHub Action documentation](docs/src/github-action.md) for all options.\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `init` | Create a new `.common-repo.yaml` |\n| `add` | Add a repository to existing config |\n| `apply` | Apply configuration (fetch, merge, write) |\n| `diff` | Preview changes before applying |\n| `ls` | List files that would be created |\n| `tree` | Show the inheritance tree |\n| `check` | Validate configuration, check for updates |\n| `update` | Update refs to newer versions |\n| `validate` | Validate configuration syntax |\n| `info` | Show configuration overview |\n| `cache` | Manage the local repository cache |\n| `completions` | Generate shell completion scripts |\n\n## Documentation\n\nFull documentation at [common-repo.github.io/common-repo](https://common-repo.github.io/common-repo/).\n\n| Guide | Description |\n|-------|-------------|\n| [Getting Started](docs/src/getting-started.md) | Installation and first steps |\n| [Configuration](docs/src/configuration.md) | All operators and options |\n| [CLI Reference](docs/src/cli.md) | Command documentation |\n| [Recipes](docs/src/recipes.md) | Configuration examples |\n| [Troubleshooting](docs/src/troubleshooting.md) | Fixes for common issues |\n| [Authoring Upstream Repos](docs/src/authoring-upstream-repos.md) | Publishing repos for others to inherit |\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and guidelines.\n\n## License\n\nThis project is licensed under the [GNU Affero General Public License v3.0](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommon-repo%2Fcommon-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommon-repo%2Fcommon-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommon-repo%2Fcommon-repo/lists"}