mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-11 04:56:41 +00:00
🐛 Fix Watch Previews action
This commit is contained in:
parent
e1ba54bd12
commit
e0080e5f75
1 changed files with 3 additions and 2 deletions
5
.github/actions/watch-previews/app/main.py
vendored
5
.github/actions/watch-previews/app/main.py
vendored
|
|
@ -67,6 +67,7 @@ if __name__ == "__main__":
|
||||||
notified = True
|
notified = True
|
||||||
logging.info(f"Docs preview was notified: {notified}")
|
logging.info(f"Docs preview was notified: {notified}")
|
||||||
if not notified:
|
if not notified:
|
||||||
|
artifact_name = f"docs-zip-{commit}"
|
||||||
response = httpx.get(
|
response = httpx.get(
|
||||||
f"{github_api}/repos/{settings.github_repository}/actions/artifacts",
|
f"{github_api}/repos/{settings.github_repository}/actions/artifacts",
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
|
@ -75,7 +76,7 @@ if __name__ == "__main__":
|
||||||
artifacts_response = ArtifactResponse.parse_obj(data)
|
artifacts_response = ArtifactResponse.parse_obj(data)
|
||||||
use_artifact: Optional[Artifact] = None
|
use_artifact: Optional[Artifact] = None
|
||||||
for artifact in artifacts_response.artifacts:
|
for artifact in artifacts_response.artifacts:
|
||||||
if artifact.name == settings.input_name:
|
if artifact.name == artifact_name:
|
||||||
use_artifact = artifact
|
use_artifact = artifact
|
||||||
break
|
break
|
||||||
if use_artifact:
|
if use_artifact:
|
||||||
|
|
@ -85,7 +86,7 @@ if __name__ == "__main__":
|
||||||
headers=headers,
|
headers=headers,
|
||||||
json={
|
json={
|
||||||
"ref": "master",
|
"ref": "master",
|
||||||
"inputs": {"pr": f"{pr.number}", "name": f"docs-zip-{commit}"},
|
"inputs": {"pr": f"{pr.number}", "name": artifact_name},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
logging.info(
|
logging.info(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue