Skip to content

Commit 824935d

Browse files
committed
Use latest spec build run for auto proto convert
Signed-off-by: xil <fridalu66@gmail.com>
1 parent a99e7ab commit 824935d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/convert-proto.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ jobs:
4848
per_page: 20
4949
});
5050
51-
const latestSuccessfulRun = runs.data.workflow_runs.find(
52-
(run) => run.conclusion === "success"
53-
);
51+
const latestRun = runs.data.workflow_runs[0];
5452
55-
if (!latestSuccessfulRun) {
56-
core.setFailed("Could not find a successful build.yml workflow run on main.");
53+
if (!latestRun) {
54+
core.setFailed("Could not find any build.yml workflow run on main.");
5755
return;
5856
}
5957
60-
core.setOutput("run_id", String(latestSuccessfulRun.id));
61-
core.setOutput("head_sha", latestSuccessfulRun.head_sha);
62-
console.log("Latest successful build run: " + latestSuccessfulRun.id);
63-
console.log("Spec commit: " + latestSuccessfulRun.head_sha);
58+
core.setOutput("run_id", String(latestRun.id));
59+
core.setOutput("head_sha", latestRun.head_sha);
60+
core.setOutput("conclusion", latestRun.conclusion || "unknown");
61+
console.log("Latest build run: " + latestRun.id);
62+
console.log("Spec commit: " + latestRun.head_sha);
63+
console.log("Build conclusion: " + (latestRun.conclusion || "unknown"));
6464
6565
- name: Download Latest Spec Build Artifact
6666
id: download_build_artifact

0 commit comments

Comments
 (0)