name: Assign Reviewers for Team

on: 
  pull_request:
    types: [opened]

jobs:
  assign_reviewer:
    name: Assign Reviewer for PR
    runs-on: ubuntu-latest
    if: |
      github.event.pull_request.draft == false && github.base_ref == 'main'
      && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' 
      && toJson(github.event.pull_request.requested_reviewers) == '[]'
    steps:
      - uses: kentaro-m/auto-assign-action@v1.2.1
        with:
          configuration-path: '.github/reviewer_list.yml'
