diff --git a/.github/workflows/auto-assign-reviewers.yml b/.github/workflows/auto-assign-reviewers.yml new file mode 100644 index 000000000000..1486f4ce063d --- /dev/null +++ b/.github/workflows/auto-assign-reviewers.yml @@ -0,0 +1,24 @@ +name: Auto-Assign Reviewers + +on: + pull_request: + types: [opened, synchronize] + +jobs: + auto-assign: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run git blame analysis + run: | + git diff HEAD^ | grep 'diff --git' | awk '{print $3}' | while read file; do + echo "Analyzing $file" + git blame -e $file + done > reviewers.txt + + - name: Assign reviewers + uses: peter-evans/create-pull-request@v5 + with: + reviewers: ${{ steps.blame.outputs.reviewers }}