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@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
        id: app-token
        with:
          app-id: ${{ secrets.VOUCH_APP_ID }}
          private-key: ${{ secrets.VOUCH_APP_PRIVATE_KEY }}

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