From 34f30674a93cfd93dd2f363ed7090650d577a625 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 18 Jan 2022 12:01:26 +0100 Subject: [PATCH] chore: setting awaiting review labels until all reviews have been fulfilled Signed-off-by: blam --- ...pr-review-or-response.yaml => goalie.yaml} | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) rename .github/workflows/{goalie-on-pr-review-or-response.yaml => goalie.yaml} (89%) diff --git a/.github/workflows/goalie-on-pr-review-or-response.yaml b/.github/workflows/goalie.yaml similarity index 89% rename from .github/workflows/goalie-on-pr-review-or-response.yaml rename to .github/workflows/goalie.yaml index a5a8aaad55..9f1f99fbd7 100644 --- a/.github/workflows/goalie-on-pr-review-or-response.yaml +++ b/.github/workflows/goalie.yaml @@ -1,5 +1,5 @@ # on a review from someone in the reviewers group, remove the awaiting-review label and add the awaiting-author label -name: Update labels for awaiting review +name: Set Goalie Labels on: pull_request_review: types: [submitted] @@ -40,9 +40,9 @@ jobs: } ) ) - + return groupMembers; - + - uses: actions/github-script@v5 id: get-all-changed-files with: @@ -66,23 +66,22 @@ jobs: }); return allReviews; - + - uses: actions/github-script@v5 id: fix-labels with: script: | // if it's the author, always add awaiting-review label - // const isAuthor = context.payload.pull_request.user.login === context.actor - // if (isAuthor) { - // github.rest.issues.addLabels({ - // issue_number: context.issue.number, - // owner: context.repo.owner, - // repo: context.repo.repo, - // labels: ['awaiting-review'] - // }); - - // return - // } + const isAuthor = context.payload.pull_request.user.login === context.actor + if (isAuthor) { + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ['awaiting-review'] + }); + return; + } // Go through each file changed and go through each codeowner entry and use minimatch to see if the file matches // strip the backstage group from the name? @@ -129,5 +128,3 @@ jobs: name: 'awaiting-review' }).catch(() => {}); } - -