Skip to content

Commit 351edb1

Browse files
committed
Fix CI: Not adding compare url in case of tag
1 parent a312c2f commit 351edb1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/ci/pr_info.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,13 @@ def __init__(
258258
self.base_name = self.repo_full_name
259259
self.head_ref = ref
260260
self.head_name = self.repo_full_name
261-
self.diff_urls.append(
262-
self.compare_url(github_event["before"], self.sha)
263-
)
261+
before_sha = github_event["before"]
262+
# in case of just a tag on exsiting commit, "before_sha" is 0000000000000000000000000000000000000000
263+
# Hence it is a special case and basically nothing changed, there is no need to compose a diff url
264+
if not all(x == '0' for x in before_sha):
265+
self.diff_urls.append(
266+
self.compare_url(before_sha, self.sha)
267+
)
264268
else:
265269
self.number = pull_request["number"]
266270
self.labels = {label["name"] for label in pull_request["labels"]}

0 commit comments

Comments
 (0)