---
name: Auto-assign

on:
  issues:
    types:
      - opened

jobs:
  auto-assign:
    name: Assign to owner
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Assign issue to owner
        uses: actions/github-script@v9
        with:
          script: |
            await github.rest.issues.addAssignees({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              assignees: [context.repo.owner],
            });
