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
".github/workflows/*.yml":
- shufo2
# 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/auto-assign-reviewer-by-files@v1.1.3
with:
config: ".github/assign-by-files.yml"
token: ${{ secrets.GITHUB_TOKEN }}
- Please check if glob pattern is correct or not
# it will matches only js files under the root directory
"*.js":
- foo
# it will matches `.github/foo.yaml` but not `.github/workflows/bar.yaml`
".github/*":
- bar
# it will match any files
"**/*":
- shufo
Shuhei Hayashibara |
Shufo2 |
Josh Soref |
Zoltan Haindrich |