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 25, 2024
1 parent 5a53437 commit 93c187f
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
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/[email protected]
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/[email protected]
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

0 comments on commit 93c187f

Please sign in to comment.