on:
  issues:
    types: [opened, reopened]

name: "Vouch - Check Issue"

jobs:
  check:
    runs-on: namespace-profile-ghostty-xsm
    steps:
      - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
        id: app-token
        with:
          app-id: ${{ secrets.VOUCH_APP_ID }}
          private-key: ${{ secrets.VOUCH_APP_PRIVATE_KEY }}

      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          sparse-checkout: .github/issue-unvouched-message

      - uses: mitchellh/vouch/action/check-issue@baeb3bf7c7e6c12d6e33bab3870b7e936580a934 # unreleased main
        with:
          issue-number: ${{ github.event.issue.number }}
          auto-close: true
          auto-lock: true
          template-file: .github/issue-unvouched-message
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
