File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
.github/actions/watch-previews/app Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ def get_message(commit: str) -> str:
49
49
owner : NamedUser = repo .owner
50
50
headers = {"Authorization" : f"token { settings .input_token .get_secret_value ()} " }
51
51
prs = list (repo .get_pulls (state = "open" ))
52
+ response = httpx .get (
53
+ f"{ github_api } /repos/{ settings .github_repository } /actions/artifacts" ,
54
+ headers = headers ,
55
+ )
56
+ data = response .json ()
57
+ artifacts_response = ArtifactResponse .parse_obj (data )
52
58
for pr in prs :
53
59
logging .info ("-----" )
54
60
logging .info (f"Processing PR #{ pr .number } : { pr .title } " )
@@ -68,19 +74,13 @@ def get_message(commit: str) -> str:
68
74
logging .info (f"Docs preview was notified: { notified } " )
69
75
if not notified :
70
76
artifact_name = f"docs-zip-{ commit } "
71
- response = httpx .get (
72
- f"{ github_api } /repos/{ settings .github_repository } /actions/artifacts" ,
73
- headers = headers ,
74
- )
75
- data = response .json ()
76
- artifacts_response = ArtifactResponse .parse_obj (data )
77
77
use_artifact : Optional [Artifact ] = None
78
78
for artifact in artifacts_response .artifacts :
79
79
if artifact .name == artifact_name :
80
80
use_artifact = artifact
81
81
break
82
82
if not use_artifact :
83
- logging .info (f "Artifact not available" )
83
+ logging .info ("Artifact not available" )
84
84
else :
85
85
logging .info (f"Existing artifact: { use_artifact .name } " )
86
86
response = httpx .post (
You can’t perform that action at this time.
0 commit comments