Skip to content

[WEEKLY RELEASE] HotShot - rc-0.5.77 #164

[WEEKLY RELEASE] HotShot - rc-0.5.77

[WEEKLY RELEASE] HotShot - rc-0.5.77 #164

name: Choose random assignees
on:
pull_request:
types: [opened, ready_for_review, reopened]
jobs:
test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Choose random assignees
run: |
# Skip PRs that have assignees already
gh pr view ${{ github.event.number }} --repo ${{ github.repository }} --json assignees \
| jq '.assignees | length > 0' -e && \
exit 0
chosen=$(perl \
-e 'use List::Util qw(shuffle head);' \
-e 'my @assignees = grep { "${{ github.event.sender.login }}" 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