Anabolic Codeowners
ActionsAnabolic Codeowners enhances GitHub’s CODEOWNERS functionality, enabling random assignment of code reviewers with per-path granularity. It’s perfect for monorepos, ensuring balanced review workload distribution.
- Randomly select reviewers from the configured pool to evenly distribute the review load
- Assign reviewers to specific paths or files in your repository, mirroring CODEOWNERS syntax for intuitive setup
- Flexibly set the number of reviewers per pull request to maintain balance between thorough review and efficiency
Create a workflow .yaml
under .github/workflows
like this:
name: Assign Reviewers
on:
pull_request:
types:
- opened
- reopened
- ready_for_review
jobs:
assign-reviewers:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Anabolic Codeowners
uses: moltinginstar/anabolic-codeowners@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
config: .github/codeowners.yaml # Configuration file, optional
num-reviewers: 1 # Reviewers per rule, optional
To use Anabolic Codeowners, you must also create a configuration file and assign users to specific filepaths. By default, this file will be named .github/codeowners.yaml
, or you can specify a different location in the workflow manifest. Here’s an example codeowners.yaml
for an Nx-based monorepo:
**/*:
- agile-codehunter
- atomic-committer
apps/app1-api/**/*:
- alluring-creator
# Override the default reviewers for a specific file
apps/app1-api/src/app.module.ts:
- apex-codex
# Exclude specific paths from review
apps/app1-api/src/config/**/*:
apps/app1-api/**/*.(spec|test).ts:
- agile-codehunter
apps/app1-web/**/*:
- anomaly-catcher
- aurora-cascade
- apex-codex
libs/app1-shared/**/*:
- agile-codehunter
- aurora-cascade
The last matching rule for a file overrides previous matches. You can use any path specifier supported by minimatch
, including:
*
and**
- Negative (
!
) patterns - POSIX character classes (e.g.,
[[:alpha:]]
) - Etc.
Contributions are very welcome! Please submit pull requests or open issues for bugs and feature requests.
Anabolic Codeowners is licensed under the MIT License.
Anabolic Codeowners is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.