Skip to content

Commit

Permalink
chore: update choosing reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
stardustmeg committed Apr 24, 2024
1 parent 59e981d commit 1e3b2d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ 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
potential_reviewers+=("$user")
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[@]}")"
Expand All @@ -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] }}

0 comments on commit 1e3b2d5

Please sign in to comment.