Skip to content

Commit

Permalink
Fixes empty head when compare the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Feb 24, 2024
1 parent 7f3df78 commit 3163378
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jobs:
run: |
from github import Auth, Github
author = "${{ github.event.pull_request.head.user.login }}"
head = "${{ github.event.pull_request.head.sha }}"
gh = Github(auth=Auth.Token("${{ secrets.GITHUB_TOKEN }}"))
repo = gh.get_repo("${{ github.repository }}")
cmp = repo.compare("${{ github.base_ref }}", "${{ github.event.head.user.login }}:${{ github.event.head.sha }}")
cmp = repo.compare("${{ github.base_ref }}", f"{author}:{head}")
if cmp.status != "behind":
pull = repo.get_pull(${{ github.event.number }})
Expand Down

0 comments on commit 3163378

Please sign in to comment.