Skip to content

Commit

Permalink
Use REVIEWERS from head of base.ref
Browse files Browse the repository at this point in the history
Signed-off-by: Michael D Kinney <[email protected]>
  • Loading branch information
mdkinney committed Jul 19, 2022
1 parent e0d28a9 commit b6c575f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/AssignReviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
# with:
# ref: ${{github.event.pull_request.base.ref}}
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v2
with:
cache: 'pip'
Expand All @@ -41,13 +41,10 @@ jobs:
from git import Git
from github import Github
Hub = None
AllReviewers = CodeOwners(open('.github/REVIEWERS').read())
LocalRepo = Git('.')
LocalRepo.fetch(
'origin',
'+refs/pull/${{ github.event.pull_request.number }}/*:refs/remotes/origin/pr/${{ github.event.pull_request.number }}/*',
depth=${{ github.event.pull_request.commits }} + 1
)
LocalRepo.fetch('origin','${{github.event.pull_request.base.ref}}', depth=1)
AllReviewers = CodeOwners(LocalRepo.show('origin/${{github.event.pull_request.base.ref}}:.github/REVIEWERS'))
LocalRepo.fetch('origin', '${{ github.event.pull_request.head.sha }}', depth=${{ github.event.pull_request.commits }} + 1)
ModifiedFiles = LocalRepo.diff(
'${{github.event.pull_request.head.sha}}~${{ github.event.pull_request.commits }}..${{github.event.pull_request.head.sha}}',
'--name-only'
Expand Down

0 comments on commit b6c575f

Please sign in to comment.