]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🔊 Add more logging to Watch Preview when artifact is not found
authorSebastián Ramírez <tiangolo@gmail.com>
Mon, 20 Jul 2020 15:13:27 +0000 (17:13 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 15:13:27 +0000 (17:13 +0200)
.github/actions/watch-previews/app/main.py

index e47f182754d239a84d963e62ad12c14c09b585fc..decfb339e9d0d1fcf31603200046e3fbef27338b 100644 (file)
@@ -79,14 +79,20 @@ if __name__ == "__main__":
                 if artifact.name == artifact_name:
                     use_artifact = artifact
                     break
-            if use_artifact:
+            if not use_artifact:
+                logging.info(f"Artifact not available")
+            else:
                 logging.info(f"Existing artifact: {use_artifact.name}")
                 response = httpx.post(
                     "https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches",
                     headers=headers,
                     json={
                         "ref": "master",
-                        "inputs": {"pr": f"{pr.number}", "name": artifact_name, "commit": commit},
+                        "inputs": {
+                            "pr": f"{pr.number}",
+                            "name": artifact_name,
+                            "commit": commit,
+                        },
                     },
                 )
                 logging.info(