@kaynooo/cli-forgejo 0.30.6 → 0.30.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4024,16 +4024,25 @@ function overall(runs) {
|
|
|
4024
4024
|
return pending.status;
|
|
4025
4025
|
return statuses.has("success") ? "success" : "skipped";
|
|
4026
4026
|
}
|
|
4027
|
+
async function repoRunners(repo) {
|
|
4028
|
+
try {
|
|
4029
|
+
return await repoApi("actions/runners", repo);
|
|
4030
|
+
} catch {
|
|
4031
|
+
return;
|
|
4032
|
+
}
|
|
4033
|
+
}
|
|
4027
4034
|
async function stallReason(runs, repo) {
|
|
4028
4035
|
const queued = runs.filter((run) => QUEUED.has(run.status));
|
|
4029
4036
|
if (queued.length === 0)
|
|
4030
4037
|
return;
|
|
4031
|
-
let
|
|
4038
|
+
let instance;
|
|
4032
4039
|
try {
|
|
4033
|
-
|
|
4040
|
+
instance = await api("admin/actions/runners");
|
|
4034
4041
|
} catch {
|
|
4035
4042
|
return;
|
|
4036
4043
|
}
|
|
4044
|
+
const own = await repoRunners(repo);
|
|
4045
|
+
const runners = [...instance, ...own ?? []];
|
|
4037
4046
|
const online = runners.filter((runner) => runner.status !== "offline");
|
|
4038
4047
|
if (online.length === 0)
|
|
4039
4048
|
return { reason: runners.length === 0 ? "no runner is registered" : `every runner is offline (${runners.map((runner) => runner.name).join(", ")})`, certain: false };
|
|
@@ -4041,7 +4050,7 @@ async function stallReason(runs, repo) {
|
|
|
4041
4050
|
for (const job of await jobsOf(run.id, repo)) {
|
|
4042
4051
|
const labels = job.runs_on ?? [];
|
|
4043
4052
|
if (QUEUED.has(job.status) && !online.some((runner) => labels.every((label) => (runner.labels ?? []).includes(label))))
|
|
4044
|
-
return { reason: `job ${job.name} of ${run.workflow_id} runs on ${labels.join(", ")}, which no online runner carries (${online.map((runner) => `${runner.name}: ${(runner.labels ?? []).join(", ")}`).join("; ")})`, certain:
|
|
4053
|
+
return { reason: `job ${job.name} of ${run.workflow_id} runs on ${labels.join(", ")}, which no online runner carries (${online.map((runner) => `${runner.name}: ${(runner.labels ?? []).join(", ")}`).join("; ")})`, certain: own !== undefined };
|
|
4045
4054
|
}
|
|
4046
4055
|
}
|
|
4047
4056
|
return online.some((runner) => runner.status === "active") ? undefined : { reason: "no runner is working on anything: is it up?", certain: false };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-forgejo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.30.
|
|
4
|
+
"version": "0.30.7",
|
|
5
5
|
"description": "ft: Forgejo CI runs, logs, releases and issue checklists from the terminal, through tea.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"@kaynooo/utils": "3.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@kaynooo/cli-kit": "0.46.
|
|
34
|
+
"@kaynooo/cli-kit": "0.46.1"
|
|
35
35
|
}
|
|
36
36
|
}
|