From cd949addd18e6a9a1d19544fb7884960ab210aeb Mon Sep 17 00:00:00 2001 From: Milon Date: Wed, 27 Nov 2024 08:54:32 +0100 Subject: [PATCH] update pr review labeler (#2297) Update labeler-needsreview.yml --- .github/workflows/labeler-needsreview.yml | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/labeler-needsreview.yml b/.github/workflows/labeler-needsreview.yml index 819b34b7bbd..4d895cad771 100644 --- a/.github/workflows/labeler-needsreview.yml +++ b/.github/workflows/labeler-needsreview.yml @@ -3,10 +3,17 @@ on: pull_request_target: types: [review_requested] + pull_request_review: + types: [submitted] + +permissions: + pull-requests: write + contents: write jobs: add_label: runs-on: ubuntu-latest + if: github.event_name == 'pull_request_target' steps: - uses: actions-ecosystem/action-add-labels@v1 with: @@ -14,3 +21,23 @@ jobs: - uses: actions-ecosystem/action-remove-labels@v1 with: labels: "S: Awaiting Changes" + + handle_review: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request_review' + steps: + - uses: actions-ecosystem/action-add-labels@v1 + if: | + github.event.review.state == 'changes_requested' && + (github.event.review.author_association == 'OWNER' || + github.event.review.author_association == 'MEMBER') + with: + labels: "S: Awaiting Changes" + + - uses: actions-ecosystem/action-remove-labels@v1 + if: | + github.event.review.state == 'changes_requested' && + (github.event.review.author_association == 'OWNER' || + github.event.review.author_association == 'MEMBER') + with: + labels: "S: Needs Review"