on:
  pull_request_target:
    types: [opened, reopened]

name: "Vouch - Check PR"

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

      - uses: mitchellh/vouch/action/check-pr@c6d80ead49839655b61b422700b7a3bc9d0804a9 # v1.4.2
        with:
          pr-number: ${{ github.event.pull_request.number }}
          auto-close: true
        env:
          GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
