Skip to content

On reviewed PR

On reviewed PR #99

name: On reviewed PR
on:
pull_request_review:
types:
- submitted
jobs:
add-label-changes-required:
runs-on: ubuntu-latest
# See https://github.com/cli/cli/issues/6274 - required to have "gh pr edit" working
permissions: write-all
steps:
- run: echo ${{ github.event.review.state }}
- if: ${{ github.event.review.state == 'changes_requested' }}
run: |
gh pr edit "$PR_URL" --remove-label "status: ready-for-review"
gh pr edit "$PR_URL" --add-label "status: changes required"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{ github.token }}