ci: request-reviewers: do not request PR author (#1885)

Link: https://github.com/nix-community/stylix/pull/1885
Closes: https://github.com/nix-community/stylix/issues/1867

Reviewed-by: awwpotato <awwpotato@voidq.com>
This commit is contained in:
NAHO 2025-09-06 02:50:48 +02:00 committed by GitHub
parent b1a84f8982
commit f6e9a1b624
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_REVIEWERS: 5
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
printf \
@ -46,6 +47,7 @@ jobs:
"$(
gh pr diff --name-only "$PR_NUMBER" |
jq \
--arg pr_author "$PR_AUTHOR" \
--argjson max_reviewers "$MAX_REVIEWERS" \
--raw-input \
--raw-output \
@ -67,6 +69,7 @@ jobs:
)[]
] |
unique |
map(select(. != $pr_author)) |
if length <= $max_reviewers then
. | join(",")
else