From 59e981def9c9444e59284026a79206feca587509 Mon Sep 17 00:00:00 2001 From: Margarita Golubeva Date: Thu, 25 Apr 2024 02:31:44 +0300 Subject: [PATCH] chore: update choosing reviewers --- .github/workflows/ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be9f2e8b..c13d8b84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,20 @@ jobs: - name: Select Reviewers id: select_reviewers - if: github.actor != steps.pr_author.outputs.author # Exclude the author - run: echo "::set-output name=reviewers::$(echo -n '["stardustmeg", "Kleostro", "YulikK"]' | jq -r 'shuffle | .[:2] | join(",")')" - - - name: Debug Reviewers run: | - echo "Selected reviewers: ${{ steps.select_reviewers.outputs.reviewers }}" + author="${{ steps.pr_author.outputs.author }}" + all_users=("stardustmeg" "Kleostro" "YulikK") + + potential_reviewers=() + for user in "${all_users[@]}"; do + if [[ "$user" != "$author" ]]; then + potential_reviewers+=("$user") + fi + done + + selected_reviewers=("${potential_reviewers[@]:0:2}") + + echo "::set-output name=reviewers::$(printf '%s' "${selected_reviewers[@]}")" - name: Request Review if: github.actor != steps.pr_author.outputs.author # Exclude the author