{"id":15757404,"url":"https://github.com/cbrgm/multiple-codeowners-action","last_synced_at":"2025-08-23T04:10:08.514Z","repository":{"id":219520689,"uuid":"749253535","full_name":"cbrgm/multiple-codeowners-action","owner":"cbrgm","description":"Combines multiple CODEOWNERS files into a single one at a specified location","archived":false,"fork":false,"pushed_at":"2025-08-12T22:01:38.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-19T17:45:02.866Z","etag":null,"topics":["codeowners","codeowners-files","combine","container","github","github-actions","go","multiple"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbrgm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"chrisbargmann"}},"created_at":"2024-01-28T02:26:34.000Z","updated_at":"2025-08-12T22:01:41.000Z","dependencies_parsed_at":"2024-02-16T13:26:48.511Z","dependency_job_id":"3fc443e9-a387-4af5-973d-2385513c9828","html_url":"https://github.com/cbrgm/multiple-codeowners-action","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":0.5789473684210527,"last_synced_commit":"30da053e9f632371afbec05039424377efbb6111"},"previous_names":["cbrgm/multiple-codeowners-action"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/cbrgm/multiple-codeowners-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fmultiple-codeowners-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fmultiple-codeowners-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fmultiple-codeowners-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fmultiple-codeowners-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbrgm","download_url":"https://codeload.github.com/cbrgm/multiple-codeowners-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fmultiple-codeowners-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271740730,"owners_count":24812642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"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":["codeowners","codeowners-files","combine","container","github","github-actions","go","multiple"],"created_at":"2024-10-04T09:20:44.603Z","updated_at":"2025-08-23T04:10:08.488Z","avatar_url":"https://github.com/cbrgm.png","language":"Go","readme":"# Multiple Codeowners Action\n\n**Combines multiple CODEOWNERS files into a single one at a specified location**\n\n[![GitHub release](https://img.shields.io/github/release/cbrgm/multiple-codeowners-action.svg)](https://github.com/cbrgm/multiple-codeowners-action)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cbrgm/multiple-codeowners-action)](https://goreportcard.com/report/github.com/cbrgm/multiple-codeowners-action)\n[![go-lint-test](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/go-lint-test.yml/badge.svg)](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/go-lint-test.yml)\n[![go-binaries](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/go-binaries.yml/badge.svg)](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/go-binaries.yml)\n[![container](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/container.yml/badge.svg)](https://github.com/cbrgm/multiple-codeowners-action/actions/workflows/container.yml)\n\n## About\n\nThis action automatically combines multiple [CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) files from different parts of your repository into a single, consolidated `CODEOWNERS` file. It's particularly useful in large projects where code ownership is spread across many teams and directories, helping to reduce clutter and improve maintainability of ownership definitions.\n\nSuppose your repository has the following structure with multiple `CODEOWNERS` files:\n\n```bash\n/repository-root\n│\n├── CODEOWNERS\n├── docs/\n│   └── CODEOWNERS\n├── src/\n│   ├── api/\n│   │   └── CODEOWNERS\n│   └── utils/\n│       └── CODEOWNERS\n└── tests/\n    └── CODEOWNERS\n```\n\nfile: `CODEOWNERS`\n```\n# Global fallback\n* @global-owner\n\n```\n\nfile: `docs/CODEOWNERS`\n```\n# Documentation\n* @docs-team\n\n```\n\nfile: `src/api/CODEOWNERS`\n```\n# API specific files\n* @api-team\nsubfolder @some-dev @some-other-dev\n\n```\n\nfile: `src/utils/CODEOWNERS`\n```\n# Utils folder\n* @utils-team\n\n```\n\nfile: `tests/CODEOWNERS`\n```\n# Test files\n* @test-team\n\n```\n\nWhen you run `cbrgm/multiple-codeowners-action` on this repository (assuming the default output path `.github/CODEOWNERS`), it will combine these individual CODEOWNERS files into one.\n\n```yaml\n# THIS FILE IS GENERATED, DO NOT EDIT MANUALLY!\n# File generated by https://github.com/cbrgm/multiple-codeowners-action\n#\n# GitHub Codeowners File\n#\n# https://help.github.com/articles/about-codeowners/\n#\n# These owners will be the default owners for everything in\n# the repo. Unless a later match takes precedence,\n# mentioned account names will be requested for\n# review when someone opens a pull request.\n\n* @global-owner\n/docs/* @docs-team\n/src/api/* @api-team\n/src/api/subfolder @some-dev @some-other-dev\n/src/utils/* @utils-team\n/tests/* @test-team\n```\n\n## Inputs\n\n- `output`: Optional - Path where the combined CODEOWNERS file will be written, relative to the repository root. Defaults to `.github/CODEOWNERS`.\n- `path`: Optional - Path to the repository root, if different from the default GitHub Actions workspace. Defaults to `.` (the root of the repository).\n- `dry-run`: Optional - Perform a dry run without actually writing the combined CODEOWNERS file. Defaults to `false`, meaning the combined CODEOWNERS file will be written by default.\n\n## Example Workflow\n\n```yml\nname: Update Combined CODEOWNERS\n\non:\n  push:\n    branches:\n      - main\n    paths:\n      - '**/CODEOWNERS'\n\njobs:\n  update-codeowners:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Check out repository\n      uses: actions/checkout@v4\n      with:\n        fetch-depth: 0 # Necessary for the create-pull-request action\n\n    - name: Combine CODEOWNERS Files\n      uses: cbrgm/multiple-codeowners-action@v1\n      with:\n        output: '.github/CODEOWNERS'\n\n    - name: Create Pull Request\n      uses: peter-evans/create-pull-request@v5\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        branch: update-codeowners-${{ github.run_number }}\n        commit-message: Update combined CODEOWNERS file\n        title: \"Update Combined CODEOWNERS\"\n        body: \"This PR updates the combined CODEOWNERS file.\"\n        draft: false\n\n```\n\n### Local Development\n\nYou can build this action from source using `Go`:\n\n```bash\nmake build\n```\n\n#### Container Usage\n\nThis action can be executed independently from workflows within a container. To do so, use the following command:\n\n```\npodman run --rm -it ghcr.io/cbrgm/multiple-codeowners-action:v1 --help\n```\n\n## High-Level Functionality\n\nThe action uses a BFS approach to traverse the repository's directory structure, starting from the root. It uses a queue to manage directories that need to be visited. As each directory is visited, the action checks for the presence of a `CODEOWNERS` file. If found, it processes the file by rewriting the ownership rules relative to the repository root. The rewritten rules from all `CODEOWNERS` files are combined into a single set of rules.\n\n```mermaid\ngraph TD\n    A[Start Action] --\u003e B[Parse Arguments]\n    B --\u003e C[Initialize BFS Queue]\n    C --\u003e D{Is Queue Empty?}\n    D -- Yes --\u003e E[Generate Combined CODEOWNERS]\n    D -- No --\u003e F[Dequeue Directory]\n    F --\u003e G[Check for CODEOWNERS File]\n    G -- Found --\u003e H[Process CODEOWNERS File]\n    H --\u003e I[Add Rules to Consolidated Set]\n    G -- Not Found --\u003e J[Enqueue Subdirectories]\n    J --\u003e D\n    I --\u003e D\n    E --\u003e K[Output or Dry Run]\n    K --\u003e L[End Action]\n\n```\n\n## Contributing \u0026 License\n\nWe welcome and value your contributions to this project! 👍 If you're interested in making improvements or adding features, please refer to our [Contributing Guide](https://github.com/cbrgm/multiple-codeowners-action/blob/main/CONTRIBUTING.md). This guide provides comprehensive instructions on how to submit changes, set up your development environment, and more.\n\nPlease note that this project is developed in my spare time and is available for free 🕒💻. As an open-source initiative, it is governed by the [Apache 2.0 License](https://github.com/cbrgm/multiple-codeowners-action/blob/main/LICENSE). This license outlines your rights and obligations when using, modifying, and distributing this software.\n\nYour involvement, whether it's through code contributions, suggestions, or feedback, is crucial for the ongoing improvement and success of this project. Together, we can ensure it remains a useful and well-maintained resource for everyone 🌍.\n\n","funding_links":["https://ko-fi.com/chrisbargmann"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fmultiple-codeowners-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbrgm%2Fmultiple-codeowners-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fmultiple-codeowners-action/lists"}