♻️ci: refactor auto-assign.yml #235
Workflow file for this run
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: Auto Assign | |
on: | |
issues: | |
types: | |
- opened | |
- reopened | |
pull_request_target: | |
types: | |
- opened | |
- reopened | |
env: | |
GH_TOKEN: ${{ github.token }} | |
MEMBERS: | | |
HaradaTakayuki | |
kazutan1230 | |
Marukome0743 | |
tanePON | |
jobs: | |
assign: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Assign Issue | |
if: github.event_name == 'issues' && toJSON(github.event.issue.assignees) == '[]' | |
run: | | |
echo "$MEMBERS" | | |
tail -n +2 | | |
shuf -n 1 | | |
xargs gh issue edit ${{ github.event.issue.number }} --repo ${{ github.repository }} --add-assignee | |
- name: Assign Pull Request | |
if: github.event_name == 'pull_request_target' && toJSON(github.event.pull_request.assignees) == '[]' | |
run: | | |
echo "$MEMBERS" | | |
tail -n +2 | | |
shuf -n 1 | | |
xargs gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-assignee |