name: Assign Issue

on:
  issues:
    types: [opened, edited]

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

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

      - name: Set up Python
        uses: actions/setup-python@v5
        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