





























@@ -35,9 +35,13 @@ const MAX_RUNS_TO_SCAN = 8;
3535const MAX_JOB_PAGES_PER_RUN = 2;
36363737function parseBoolean(value, fallback = false) {
38-if (value === undefined) return fallback;
38+if (value === undefined) {
39+return fallback;
40+}
3941const normalized = value.trim().toLowerCase();
40-if (normalized === "1" || normalized === "true" || normalized === "yes") return true;
42+if (normalized === "1" || normalized === "true" || normalized === "yes") {
43+return true;
44+}
4145if (normalized === "0" || normalized === "false" || normalized === "no" || normalized === "") {
4246return false;
4347}
@@ -109,7 +113,9 @@ async function collectQueuedBlacksmithJobs({ repository, token }) {
109113token,
110114);
111115for (const job of jobs.jobs ?? []) {
112-if (job.status !== "queued") continue;
116+if (job.status !== "queued") {
117+continue;
118+}
113119for (const label of job.labels ?? []) {
114120if (typeof label === "string" && label.startsWith("blacksmith-")) {
115121runCounts[label] = (runCounts[label] ?? 0) + 1;
@@ -135,7 +141,7 @@ function writeOutputs(outputs) {
135141return;
136142}
137143for (const [key, value] of Object.entries(outputs)) {
138-appendFileSync(outputPath, `${key}=${value}\n`, "utf8");
144+appendFileSync(outputPath, `${key}=${String(value)}\n`, "utf8");
139145}
140146}
141147@@ -156,7 +162,8 @@ async function main() {
156162token: process.env.GITHUB_TOKEN,
157163});
158164} catch (error) {
159-console.log(`::warning title=Blacksmith fallback probe failed::${error.message}`);
165+const message = error instanceof Error ? error.message : String(error);
166+console.log(`::warning title=Blacksmith fallback probe failed::${message}`);
160167}
161168}
162169此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。