From f45ed1a3f69541beb89234c68a5bccc0efa59a9a Mon Sep 17 00:00:00 2001 From: "Po-Wei Wang (Vincent)" Date: Sun, 1 Jun 2025 16:25:15 -0700 Subject: [PATCH] make auto-assign work for PRs --- .github/workflows/auto-assign.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml index 5ecb067cc01b..c08f545b6427 100644 --- a/.github/workflows/auto-assign.yml +++ b/.github/workflows/auto-assign.yml @@ -3,6 +3,9 @@ on: issues: types: - labeled + pull_request: + types: + - labeled jobs: assign_issue: @@ -38,6 +41,12 @@ jobs: result-encoding: string - name: Assign - run: gh issue edit ${{ github.event.issue.number }} --add-label "triaged" --add-label "investigating" --add-assignee ${{ steps.get-assignee.outputs.result }} + if: steps.get-assignee.outputs.result != '' + run: | + if [ "${{ github.event_name }}" == "issues" ]; then + gh issue edit ${{ github.event.issue.number }} --add-label "triaged" --add-label "investigating" --add-assignee ${{ steps.get-assignee.outputs.result }} + elif [ "${{ github.event_name }}" == "pull_request" ]; then + gh pr edit ${{ github.event.pull_request.number }} --add-label "triaged" --add-label "investigating" --add-assignee ${{ steps.get-assignee.outputs.result }} + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}