Skip to content

Commit 11c05be

Browse files
authored
🔊 Add more logging to Watch Preview when artifact is not found
1 parent 7b3ef43 commit 11c05be

File tree

1 file changed

+8
-2
lines changed
  • .github/actions/watch-previews/app

1 file changed

+8
-2
lines changed

.github/actions/watch-previews/app/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,20 @@ def get_message(commit: str) -> str:
7979
if artifact.name == artifact_name:
8080
use_artifact = artifact
8181
break
82-
if use_artifact:
82+
if not use_artifact:
83+
logging.info(f"Artifact not available")
84+
else:
8385
logging.info(f"Existing artifact: {use_artifact.name}")
8486
response = httpx.post(
8587
"https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches",
8688
headers=headers,
8789
json={
8890
"ref": "master",
89-
"inputs": {"pr": f"{pr.number}", "name": artifact_name, "commit": commit},
91+
"inputs": {
92+
"pr": f"{pr.number}",
93+
"name": artifact_name,
94+
"commit": commit,
95+
},
9096
},
9197
)
9298
logging.info(

0 commit comments

Comments
 (0)