mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 07:16:42 +00:00
Check commits array is not empty
This commit is contained in:
4
main.py
4
main.py
@@ -67,8 +67,8 @@ class GitHubClient(object):
|
|||||||
|
|
||||||
def get_last_diff(self):
|
def get_last_diff(self):
|
||||||
"""Get the last diff."""
|
"""Get the last diff."""
|
||||||
if self.before != '0000000000000000000000000000000000000000':
|
if self.before != '0000000000000000000000000000000000000000' or len(self.commits) == 0:
|
||||||
# There is a valid before SHA to compare with
|
# There is a valid before SHA to compare with, or this is a release being created
|
||||||
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}'
|
||||||
elif len(self.commits) == 1:
|
elif len(self.commits) == 1:
|
||||||
# There is only one commit
|
# There is only one commit
|
||||||
|
|||||||
Reference in New Issue
Block a user