name: Assign Issue

on:
  issues:
    types: [opened, edited]

jobs:
  assign:
    runs-on: ubuntu-latest
    permissions:
      issues: write

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v6

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.x"

      - name: Install Dependencies
        run: |
          python -m pip install --upgrade PyGithub

      - name: Assign Issue
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: python .github/workflows/issue_assigner/assign_issue.py
