7
7
OWNER = "iree-org"
8
8
REPO = "iree"
9
9
10
- API_URL = f"https://api.github.com/repos/{ OWNER } /{ REPO } /actions/workflows/pkgci.yml/runs"
10
+ API_URL = (
11
+ f"https://api.github.com/repos/{ OWNER } /{ REPO } /actions/workflows/pkgci.yml/runs"
12
+ )
13
+
11
14
12
15
# Get the latest workflow run ID for pkgci.yml
13
16
def get_latest_pkgci_workflow_run ():
@@ -35,6 +38,7 @@ def get_latest_pkgci_workflow_run():
35
38
print (f"Error fetching workflow runs: { response .status_code } " )
36
39
return None
37
40
41
+
38
42
# Get the artifacts of a specific workflow run
39
43
def get_artifacts (workflow_run_id , artifacts_url ):
40
44
headers = {
@@ -50,12 +54,13 @@ def get_artifacts(workflow_run_id, artifacts_url):
50
54
print (f"Artifacts for pkgci.yml workflow run { workflow_run_id } :" )
51
55
for artifact in artifacts :
52
56
print (f"- { artifact ['name' ]} (Size: { artifact ['size_in_bytes' ]} bytes)" )
53
- download_artifact (artifact [' archive_download_url' ], artifact [' name' ])
57
+ download_artifact (artifact [" archive_download_url" ], artifact [" name" ])
54
58
else :
55
59
print ("No artifacts found for the pkgci.yml workflow run." )
56
60
else :
57
61
print (f"Error fetching artifacts: { response .status_code } " )
58
62
63
+
59
64
# Download an artifact
60
65
def download_artifact (download_url , artifact_name ):
61
66
headers = {
@@ -76,6 +81,7 @@ def download_artifact(download_url, artifact_name):
76
81
else :
77
82
print (f"Error downloading artifact '{ artifact_name } ': { response .status_code } " )
78
83
84
+
79
85
if __name__ == "__main__" :
80
86
workflow_run_id , artifact_url = get_latest_pkgci_workflow_run ()
81
87
if workflow_run_id :
0 commit comments