Skip to content

Commit f4074d9

Browse files
authored
Always deploy preview if site artifact is present (microsoft#3108)
1 parent 7832b6a commit f4074d9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/deploy-preview.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,18 @@ jobs:
107107
console.log(`Found workflow run ${workflowRun.html_url}`)
108108
console.log(workflowRun)
109109
110-
if (workflowRun.conclusion !== "success") {
111-
console.log(`Workflow run did not succeed`);
110+
try {
111+
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
112+
owner: "microsoft",
113+
repo: "TypeScript-Website",
114+
run_id: 9164276500,
115+
})
116+
if (!artifacts.data.artifacts.some(x => x.name === "site")) {
117+
console.log("No artifact found in workflow run");
118+
return null;
119+
}
120+
} catch (e) {
121+
console.log(e);
112122
return null;
113123
}
114124

0 commit comments

Comments
 (0)