name: Re-draft on review
on:
  pull_request_review:
    types: [submitted]

jobs:
  redraft:
    # TODO: doesn't work due to perms issue. https://github.com/commaai/opendbc/actions/runs/16079182504/job/45380739128?pr=2385
    if: false
    #if: github.event.review.state == 'changes_requested'
    permissions:
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - run: gh pr ready --undo "${{ github.event.pull_request.number }}"
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
