mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 15:22:59 +00:00
Add diff url for first branch commit
This commit is contained in:
4
main.py
4
main.py
@@ -63,6 +63,10 @@ class GitHubClient(object):
|
|||||||
|
|
||||||
def get_last_diff(self):
|
def get_last_diff(self):
|
||||||
"""Get the last diff based on the SHA of the last two commits."""
|
"""Get the last diff based on the SHA of the last two commits."""
|
||||||
|
if not self.before or self.before.startswith('000000'):
|
||||||
|
# Last commit SHA is empty which means this is the first commit of the branch
|
||||||
|
diff_url = f'{self.repos_url}{self.repo}/commits/{self.sha}'
|
||||||
|
else:
|
||||||
diff_url = f'{self.repos_url}{self.repo}/compare/{self.before}...{self.sha}'
|
diff_url = f'{self.repos_url}{self.repo}/compare/{self.before}...{self.sha}'
|
||||||
diff_headers = {
|
diff_headers = {
|
||||||
'Accept': 'application/vnd.github.v3.diff',
|
'Accept': 'application/vnd.github.v3.diff',
|
||||||
|
|||||||
Reference in New Issue
Block a user