From 4b6c80501f098a6ce0cf1817a1be174c3e95183a Mon Sep 17 00:00:00 2001 From: alstr Date: Thu, 26 Aug 2021 19:03:31 +0100 Subject: [PATCH] Check commits array is not empty --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index dbfb684..3090838 100644 --- a/main.py +++ b/main.py @@ -67,8 +67,8 @@ class GitHubClient(object): def get_last_diff(self): """Get the last diff.""" - if self.before != '0000000000000000000000000000000000000000': - # There is a valid before SHA to compare with + if self.before != '0000000000000000000000000000000000000000' or len(self.commits) == 0: + # 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}' elif len(self.commits) == 1: # There is only one commit