diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 0f160b8..01008f5 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -10,22 +10,31 @@ on: - opened - reopened -permissions: - issues: write - pull-requests: write - env: - REPOSITORY_OWNER: OpenUp-LabTakizawa + GH_TOKEN: ${{ github.token }} + MEMBERS: | + HaradaTakayuki + kazutan1230 + Marukome0743 + tanePON jobs: - run: + assign: runs-on: ubuntu-latest steps: - - name: Auto-assign issue - if: github.repository_owner == env.REPOSITORY_OWNER - uses: pozil/auto-assign-issue@v1 - with: - assignees: HaradaTakayuki,kazutan1230,Marukome0743,tanePON - numOfAssignee: 1 - abortIfPreviousAssignees: true + - 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