name: Issue moderator

on:
  issues:
    types: [ opened, edited, reopened ]
  issue_comment:
    types: [ created ]

jobs:
  autoclose:
    runs-on: ubuntu-latest
    steps:
    - name: Moderate issues
      uses: keiyoushi/issue-moderator-action@a017be83547db6e107431ce7575f53c1dfa3296a # v2
      with:
        repo-token: ${{ secrets.ISSUE_MODERATION_PAT }}
        auto-close-rules: |
          [
            {
              "type": "body",
              "regex": "- \\[[xX]\\] I have admitted that I am a clown by having checked this box, as I have not read these acknowledgements\\.",
              "labels": [":clown_face:"],
              "message": "You have not carefully read the acknowledgements."
            }
          ]
        auto-close-ignore-label: do-not-autoclose
