name: Assign Issue

on:
  schedule:
    - cron: 0 0 * * *
  issue_comment:
    types: [created]
  workflow_dispatch:

jobs:
  assign:
    permissions:
      issues: write
    runs-on: ubuntu-latest
    steps:
      - name: Assign the user or unassign stale assignments
        # Note: v3.0.0 is broken (dist/index.mjs vs action.yml expects index.js)
        # See: https://github.com/takanome-dev/assign-issue-action/issues/426
        uses: takanome-dev/assign-issue-action@v2.2
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          maintainers: 'noisyfox,softfever'
          days_until_unassign: 30
          block_assignment: false
          reminder_days: 7
          max_assignments: 12
