[Tech Debt] Remove the orchestrator and rewrite the examples #382
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
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 |