name: Rho PR Policy

on:
  pull_request_target:
    types: [opened, reopened, synchronize, ready_for_review]
  workflow_dispatch:

permissions:
  contents: read
  pull-requests: write

jobs:
  policy:
    runs-on: namespace-profile-linux-medium
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.base.sha || github.sha }}

      - uses: ./action/setup-rho

      - uses: ./action/check-pr
        with:
          pr-number: ${{ github.event.pull_request.number }}
          auto-close: "false"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
