From 24e77c942488ca77c7d77c8d0efd019573646beb Mon Sep 17 00:00:00 2001 From: Artemii Gerasimovich Date: Fri, 16 Aug 2024 01:53:31 +0200 Subject: [PATCH] Add random assignees workflow --- .github/workflows/assign-reviewers.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/assign-reviewers.yml diff --git a/.github/workflows/assign-reviewers.yml b/.github/workflows/assign-reviewers.yml new file mode 100644 index 0000000000..d3e9774ce5 --- /dev/null +++ b/.github/workflows/assign-reviewers.yml @@ -0,0 +1,21 @@ +name: Assign reviewers +on: + pull_request_target: + types: [opened, ready_for_review, reopened] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Assign reviewers + run: | + chosen=$(perl \ + -e 'use List::Util qw(shuffle head);' \ + -e 'my @assignees = grep { "${{ github.event.sender }}" ne $_ } shuffle split /\s+/, $ENV{ASSIGNEES};' \ + -e 'print join ",", head $ENV{NUM_ASSIGNEES}, @assignees' \ + ) + gh pr edit ${{ github.event.number }} --add-assignee $chosen --repo ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ github.token }} + NUM_ASSIGNEES: 2 + ASSIGNEES: jparr721 rob-maron ss-es bfish713 QuentinI shenkeyao lukaszrzasik lukeiannucci