mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 02:51:10 +00:00
fix(ci): handle empty commit lookup responses
This commit is contained in:
1 parent
51407155fc
commit
1355cb3a2b
2 files changed
+8
-1
No files matched your search
@@ -158,7 +158,7 @@ def sync(mode, repo, number, discord, sha="", apk="", release=""):
|
||||
"allowed_mentions": {"parse": []}, "flags": 4})
|
||||
return
|
||||
try:
|
||||
commit = github(f"repos/{repo}/commits/{sha}")
|
||||
commit = github(f"repos/{repo}/commits/{sha}") or {}
|
||||
except RuntimeError:
|
||||
commit = {}
|
||||
commit_message = (commit.get("commit") or {}).get("message", "")
|
||||
|
||||
@@ -250,6 +250,13 @@ class PrDiscordTest(unittest.TestCase):
|
||||
self.assertEqual("POST", self.discord.request.call_args.args[0])
|
||||
self.assertNotIn("Latest commit:", self.discord.request.call_args.args[2]["content"])
|
||||
|
||||
def test_empty_commit_response_does_not_block_announcement(self):
|
||||
self.github.side_effect = lambda path, method="GET", body=None: (
|
||||
self.pull if "/pulls/" in path else None if "/commits/" in path else self.comment)
|
||||
self.publish()
|
||||
self.assertEqual("POST", self.discord.request.call_args.args[0])
|
||||
self.assertNotIn("Latest commit:", self.discord.request.call_args.args[2]["content"])
|
||||
|
||||
|
||||
original_report = module.report_comment
|
||||
|
||||
|
||||
Reference in new issue
Block a user