File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto-Assign Reviewers
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize]
6+
7+ jobs :
8+ auto-assign :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v3
13+ with :
14+ fetch-depth : 0
15+
16+ - name : Fetch base branch
17+ run : |
18+ git fetch origin ${{ github.event.pull_request.base.ref }} # Fetch the base branch reference
19+
20+ - name : Run git blame analysis
21+ run : |
22+ # Calculate the diff between the base branch and the current commit
23+ git diff origin/${{ github.event.pull_request.base.ref }} --name-only | while read file; do
24+ echo "Analyzing $file"
25+ git blame -e $file || echo "Error analyzing $file"
26+ done > reviewers.txt
27+
28+ - name : Print reviewers list
29+ run : cat reviewers.txt
30+
31+ - name : Create pull request for changes
32+ uses : peter-evans/create-pull-request@v5
33+ with :
34+ token : ${{ secrets.GITHUB_TOKEN }}
35+ base : ${{ github.event.pull_request.base.ref }}
36+ branch : create-pull-request/patch
37+ commit-message : " [create-pull-request] Automated change"
38+ title : Changes by create-pull-request action
39+ body : |
40+ Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
41+ reviewers : michal-shalev
You can’t perform that action at this time.
0 commit comments