A Github Action that automatically assigns reviewers to PR based on changed files
create configuration file
.github/assign-by-files.yml
---
# you can use glob pattern
'*.js':
- shufo
# you can set multiple reviewers
'.github/**/*.yml':
- foo
- bar
Glob matching is based on the minimatch library.
create action file
.github/workflows/auto-assign.yml
name: "Auto Assign"
on:
- pull_request
jobs:
assign_reviewer:
runs-on: ubuntu-latest
steps:
- uses: shufo/[email protected]
with:
config: '.github/assign-by-files.yml'
token: ${{ secrets.GITHUB_TOKEN }}