-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add random assignees workflow (#3581)
* Add random assignees workflow
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Choose random assignees | ||
on: | ||
pull_request: | ||
types: [opened, ready_for_review, reopened] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Choose random assignees | ||
run: | | ||
chosen=$(perl \ | ||
-e 'use List::Util qw(shuffle head);' \ | ||
-e 'my @assignees = grep { "${{ github.event.actor }}" 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 |