name: 👤🎟️
on:
  pull_request:
    types: [opened]

jobs:
  assign:
    if: github.actor == 'dependabot[bot]'
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: Assign reviewer and assignee
        uses: actions/github-script@v8
        with:
          script: |
            await github.rest.pulls.requestReviewers({
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.issue.number,
              reviewers: ['r3bo0tbx1']
            });
            await github.rest.issues.addAssignees({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              assignees: ['r3bo0tbx1']
            });