willfire 0.1.30 → 0.1.32
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Val } from "../expr/val.js";
|
|
2
|
+
import type { Workflow } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Every declared input bound to the empty string, which is what an absent one
|
|
5
|
+
* reads as. `default:` is deliberately ignored: a default is applied by the
|
|
6
|
+
* dispatch or the call, and on a `pull_request` neither happened.
|
|
7
|
+
*/
|
|
8
|
+
export declare function absentInputs(wf: Workflow): Record<string, Val>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The two triggers that carry an `inputs` context. A `pull_request` is neither. */
|
|
2
|
+
const INPUT_TRIGGERS = ["workflow_dispatch", "workflow_call"];
|
|
3
|
+
/**
|
|
4
|
+
* Every declared input bound to the empty string, which is what an absent one
|
|
5
|
+
* reads as. `default:` is deliberately ignored: a default is applied by the
|
|
6
|
+
* dispatch or the call, and on a `pull_request` neither happened.
|
|
7
|
+
*/
|
|
8
|
+
export function absentInputs(wf) {
|
|
9
|
+
// Tolerates the YAML 1.1 `on` -> true key, as the callee's own lookup does.
|
|
10
|
+
const on = wf["on"] ?? wf["true"];
|
|
11
|
+
const out = {};
|
|
12
|
+
for (const trigger of INPUT_TRIGGERS) {
|
|
13
|
+
for (const name of Object.keys(on?.[trigger]?.["inputs"] ?? {})) {
|
|
14
|
+
out[name] = { kind: "value", v: "" };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
package/dist/jobs/expandJobs.js
CHANGED
|
@@ -3,6 +3,7 @@ import { expandMatrixDetailed } from "../matrix/expandMatrixDetailed.js";
|
|
|
3
3
|
import { jobDisplayName } from "../names/jobDisplayName.js";
|
|
4
4
|
import { skippedDisplayName } from "../names/skippedDisplayName.js";
|
|
5
5
|
import { parseUses } from "../uses/parseUses.js";
|
|
6
|
+
import { absentInputs } from "./absentInputs.js";
|
|
6
7
|
import { calleeInputs } from "./calleeInputs.js";
|
|
7
8
|
import { evalIf } from "./evalIf.js";
|
|
8
9
|
import { neededJobIds } from "./neededJobIds.js";
|
|
@@ -23,10 +24,13 @@ export async function expandJobs(wf, ctx, reader, source, depth = 0, prefix = ""
|
|
|
23
24
|
const entries = [];
|
|
24
25
|
const jobs = wf.jobs ?? {};
|
|
25
26
|
const statuses = {};
|
|
27
|
+
// Nothing dispatched or called this run, so an input this workflow declares
|
|
28
|
+
// and nothing supplied reads as the empty string (#125) — laid under, never
|
|
29
|
+
// over, whatever the caller bound.
|
|
30
|
+
let scoped = { ...scope, inputs: { ...absentInputs(wf), ...scope.inputs } };
|
|
26
31
|
// Selection is derived, never configured: execute exactly the jobs some
|
|
27
32
|
// sibling's `needs.*.outputs` read depends on, under the same `evalIf`
|
|
28
33
|
// verdict the main loop applies.
|
|
29
|
-
let scoped = scope;
|
|
30
34
|
const execFailures = {};
|
|
31
35
|
if (executor !== undefined) {
|
|
32
36
|
const needed = neededJobIds(jobs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "willfire",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Predict the set of CI check entries GitHub Actions will create for a pull request",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"packageManager": "pnpm@10.33.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@types/node": "^22.0.0",
|
|
55
55
|
"@vitest/coverage-v8": "^4.1.10",
|
|
56
56
|
"eslint": "^10.9.1",
|
|
57
|
-
"testing-conventions": "^0.0.
|
|
57
|
+
"testing-conventions": "^0.0.94",
|
|
58
58
|
"tsx": "^4.19.0",
|
|
59
59
|
"typescript": "^5.6.0",
|
|
60
60
|
"typescript-eslint": "^8.68.0",
|