From 93c187fae85f51857d4592593200e591938c5e14 Mon Sep 17 00:00:00 2001 From: Margarita Golubeva Date: Thu, 25 Apr 2024 03:06:40 +0300 Subject: [PATCH] chore: update choosing reviewers --- .github/workflows/ci.yml | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 619ce8af..3a606c45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,12 +35,8 @@ jobs: id: pr_author run: echo "::set-output name=author::${{ github.event.pull_request.user.login }}" - - name: Debug PR Author - run: | - echo "PR Author: ${{ steps.pr_author.outputs.author }}" - - name: Assign Reviewers - id: assign_reviewers + if: github.actor != steps.pr_author.outputs.author # Exclude the author run: | author="${{ steps.pr_author.outputs.author }}" if [[ "$author" == "stardustmeg" ]]; then @@ -56,28 +52,13 @@ jobs: echo "Author not found." exit 1 fi - echo "::set-output name=first_reviewer::${first_reviewer}" - echo "::set-output name=second_reviewer::${second_reviewer}" - - - name: Debug Reviewers - run: | - echo "First Reviewer: ${{ steps.assign_reviewers.outputs.first_reviewer }}" - echo "Second Reviewer: ${{ steps.assign_reviewers.outputs.second_reviewer }}" + echo "First Reviewer: $first_reviewer" + echo "Second Reviewer: $second_reviewer" - - name: Request First Reviewer - if: github.actor != steps.pr_author.outputs.author # Exclude the author - uses: octokit/request-action@v2.x - with: - route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers - mediaType: '{"previews":["luke-cage"]}' - token: ${{ secrets.GITHUB_TOKEN }} - reviewers: ${{ steps.assign_reviewers.outputs.first_reviewer }} - - - name: Request Second Reviewer - if: github.actor != steps.pr_author.outputs.author # Exclude the author - uses: octokit/request-action@v2.x - with: - route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers - mediaType: '{"previews":["luke-cage"]}' - token: ${{ secrets.GITHUB_TOKEN }} - reviewers: ${{ steps.assign_reviewers.outputs.second_reviewer }} + # Request both reviewers + octokit/request-action@v2.x + with: + route: POST /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers + mediaType: '{"previews":["luke-cage"]}' + token: ${{ secrets.GITHUB_TOKEN }} + reviewers: $first_reviewer, $second_reviewer