From 1e3b2d5bb572e74d5c4bfbeb7bb50b0d898d81f6 Mon Sep 17 00:00:00 2001 From: Margarita Golubeva Date: Thu, 25 Apr 2024 02:34:22 +0300 Subject: [PATCH] chore: update choosing reviewers --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c13d8b84..da65af24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: author="${{ steps.pr_author.outputs.author }}" all_users=("stardustmeg" "Kleostro" "YulikK") + # Exclude the PR author from the list of potential reviewers potential_reviewers=() for user in "${all_users[@]}"; do if [[ "$user" != "$author" ]]; then @@ -48,6 +49,7 @@ jobs: fi done + # Select two reviewers from the potential reviewers list selected_reviewers=("${potential_reviewers[@]:0:2}") echo "::set-output name=reviewers::$(printf '%s' "${selected_reviewers[@]}")" @@ -59,4 +61,4 @@ jobs: route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers mediaType: '{"previews":["luke-cage"]}' token: ${{ secrets.GITHUB_TOKEN }} - reviewers: ${{ steps.select_reviewers.outputs.reviewers }} + reviewers: ${{ steps.select_reviewers.outputs.reviewers[0] }}, ${{ steps.select_reviewers.outputs.reviewers[1] }}