Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moltinginstar/anabolic-codeowners
CODEOWNERS on steroids: A GitHub Action built for monorepos.
https://github.com/moltinginstar/anabolic-codeowners
ci code-review codeowners github-actions
Last synced: about 18 hours ago
JSON representation
CODEOWNERS on steroids: A GitHub Action built for monorepos.
- Host: GitHub
- URL: https://github.com/moltinginstar/anabolic-codeowners
- Owner: moltinginstar
- License: mit
- Created: 2024-03-30T11:43:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-21T10:53:58.000Z (1 day ago)
- Last Synced: 2024-12-21T11:29:40.706Z (1 day ago)
- Topics: ci, code-review, codeowners, github-actions
- Language: TypeScript
- Homepage:
- Size: 1.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
Anabolic Codeowners
CODEOWNERS on steroids. Built for monorepos.
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
![CI](https://github.com/moltinginstar/anabolic-codeowners/actions/workflows/ci.yaml/badge.svg)
[![Check dist/](https://github.com/moltinginstar/anabolic-codeowners/actions/workflows/check-dist.yaml/badge.svg)](https://github.com/moltinginstar/anabolic-codeowners/actions/workflows/check-dist.yaml)
[![CodeQL](https://github.com/moltinginstar/anabolic-codeowners/actions/workflows/codeql-analysis.yaml/badge.svg)](https://github.com/moltinginstar/anabolic-codeowners/actions/workflows/codeql-analysis.yaml)
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)Anabolic 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.
## Features
- 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## Usage
### Definition
Create a workflow `.yaml` under `.github/workflows` like this:
```yaml
name: Assign Reviewerson:
pull_request:
types:
- opened
- reopened
- ready_for_reviewjobs:
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
```### Configuration
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:
```yaml
**/*:
- agile-codehunter
- atomic-committerapps/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-codehunterapps/app1-web/**/*:
- anomaly-catcher
- aurora-cascade
- apex-codexlibs/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`](https://github.com/isaacs/minimatch), including:
- `*` and `**`
- Negative (`!`) patterns
- POSIX character classes (e.g., `[[:alpha:]]`)
- Etc.## Contributing
Contributions are very welcome! Please submit pull requests or open issues for bugs and feature requests.
## License
Anabolic Codeowners is licensed under the [MIT License](LICENSE).