/auto-assign-reviewer-by-files

A Github Action automatically assigns reviewers to PR based on changed files

Primary LanguageJavaScriptMIT LicenseMIT

CI

Auto Assign Reviewer By Files

A Github Action that automatically assigns reviewers to PR based on changed files

Configuration

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 }}

Example

image

Troubleshooting

Does not match any files

  • 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

Contributors

shufo
Shuhei Hayashibara
shufo2
Shufo2
jsoref
Josh Soref
kgyrtkirk
Zoltan Haindrich