gagen 0.2.7 → 0.2.9
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/esm/expression.d.ts +20 -5
- package/esm/expression.d.ts.map +1 -1
- package/esm/expression.js +123 -11
- package/esm/job.d.ts.map +1 -1
- package/esm/job.js +8 -5
- package/esm/mod.d.ts +2 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/esm/step.d.ts.map +1 -1
- package/esm/step.js +2 -2
- package/package.json +1 -1
package/esm/expression.d.ts
CHANGED
|
@@ -23,11 +23,6 @@ export declare class ExpressionValue {
|
|
|
23
23
|
/** wrap in `${{ }}` for use in YAML */
|
|
24
24
|
toString(): string;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* A boolean condition used in `if` fields. Supports fluent `.and()`, `.or()`,
|
|
28
|
-
* `.not()` composition. Tracks all ExpressionSources referenced so that
|
|
29
|
-
* dependencies can be inferred automatically.
|
|
30
|
-
*/
|
|
31
26
|
export declare abstract class Condition {
|
|
32
27
|
readonly sources: ReadonlySet<ExpressionSource>;
|
|
33
28
|
constructor(sources: ReadonlySet<ExpressionSource>);
|
|
@@ -52,6 +47,8 @@ export declare abstract class Condition {
|
|
|
52
47
|
flattenAnd(): Condition[];
|
|
53
48
|
/** returns the flat OR children of this condition as Condition objects */
|
|
54
49
|
flattenOr(): Condition[];
|
|
50
|
+
/** returns true if this condition always evaluates to true */
|
|
51
|
+
isAlwaysTrue(): boolean;
|
|
55
52
|
/** render without `${{ }}` wrapping */
|
|
56
53
|
abstract toExpression(): string;
|
|
57
54
|
/** render wrapped in `${{ }}` for YAML `if` fields */
|
|
@@ -74,6 +71,8 @@ export declare class FunctionCallCondition extends Condition {
|
|
|
74
71
|
export declare class RawCondition extends Condition {
|
|
75
72
|
#private;
|
|
76
73
|
constructor(expression: string, sources: ReadonlySet<ExpressionSource>);
|
|
74
|
+
isAlwaysTrue(): boolean;
|
|
75
|
+
not(): Condition;
|
|
77
76
|
toExpression(): string;
|
|
78
77
|
}
|
|
79
78
|
/** Creates an ExpressionValue from a raw expression string. */
|
|
@@ -171,6 +170,10 @@ export declare const conditions: {
|
|
|
171
170
|
*/
|
|
172
171
|
readonly isRunnerArch: (arch: "X86" | "X64" | "ARM" | "ARM64") => Condition;
|
|
173
172
|
};
|
|
173
|
+
/** Checks if a condition-like value always evaluates to true. */
|
|
174
|
+
export declare function isAlwaysTrue(c: Condition | ExpressionValue | string): boolean;
|
|
175
|
+
/** Checks if a condition-like value always evaluates to false. */
|
|
176
|
+
export declare function isAlwaysFalse(c: Condition | ExpressionValue | string): boolean;
|
|
174
177
|
export declare function formatLiteral(value: string | number | boolean): string;
|
|
175
178
|
export declare function sourcesFrom(...sourceables: ({
|
|
176
179
|
source?: ExpressionSource;
|
|
@@ -208,5 +211,17 @@ export declare class ElseIfBuilder {
|
|
|
208
211
|
/** Provide the value for this branch. */
|
|
209
212
|
then(value: TernaryValue): ThenBuilder;
|
|
210
213
|
}
|
|
214
|
+
/** Maps a property type to Condition (for booleans/conditions) or ExpressionValue (for values). */
|
|
215
|
+
export type ExprOf<T> = [T] extends [boolean | Condition] ? Condition : ExpressionValue;
|
|
216
|
+
/** Maps all properties of an object to their expression/condition form. */
|
|
217
|
+
export type ExprMap<T extends Record<string, unknown>> = {
|
|
218
|
+
readonly [K in keyof T & string]: ExprOf<T[K]>;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Converts an object with plain values into an object with typed
|
|
222
|
+
* Condition/ExpressionValue properties. Booleans become Conditions,
|
|
223
|
+
* strings/numbers become ExpressionValues that serialize inline.
|
|
224
|
+
*/
|
|
225
|
+
export declare function defineExprObj<const T extends Record<string, unknown>>(obj: T): ExprMap<T>;
|
|
211
226
|
export {};
|
|
212
227
|
//# sourceMappingURL=expression.d.ts.map
|
package/esm/expression.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../src/expression.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAIvD,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC;AAEvE;;;GAGG;AACH,qBAAa,eAAe;;IAE1B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;gBAI5C,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAa3D,sDAAsD;IACtD,IAAI,UAAU,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAE9C;IAED,oDAAoD;IACpD,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS;IASnD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS;IAStD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAQrC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAQtC,GAAG,IAAI,SAAS;IAIhB,uCAAuC;IACvC,QAAQ,IAAI,MAAM;CAGnB;
|
|
1
|
+
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../src/expression.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAIvD,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC;AAEvE;;;GAGG;AACH,qBAAa,eAAe;;IAE1B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;gBAI5C,UAAU,EAAE,MAAM,EAClB,MAA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I;IACvD,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,GAAG,EAAE,CAAC,GACL,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
|
package/esm/expression.js
CHANGED
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _ExpressionValue_expression, _ExpressionValue_allSources, _ComparisonCondition_left, _ComparisonCondition_op, _ComparisonCondition_right, _FunctionCallCondition_fn, _FunctionCallCondition_args, _LogicalCondition_instances, _a, _LogicalCondition_left, _LogicalCondition_right, _LogicalCondition_needsParens, _NotCondition_inner, _RawCondition_expression, _ThenBuilder_branches, _ThenBuilder_sources, _ElseIfBuilder_branches, _ElseIfBuilder_sources, _ElseIfBuilder_condition;
|
|
12
|
+
var _ExpressionValue_expression, _ExpressionValue_allSources, _ComparisonCondition_left, _ComparisonCondition_op, _ComparisonCondition_right, _FunctionCallCondition_fn, _FunctionCallCondition_args, _LogicalCondition_instances, _a, _LogicalCondition_left, _LogicalCondition_right, _LogicalCondition_needsParens, _NotCondition_inner, _RawCondition_expression, _ThenBuilder_branches, _ThenBuilder_sources, _ElseIfBuilder_branches, _ElseIfBuilder_sources, _ElseIfBuilder_condition, _InlineValue_plainValue;
|
|
13
13
|
const EMPTY_SOURCES = new Set();
|
|
14
14
|
/**
|
|
15
15
|
* An expression that resolves to a value inside a GitHub Actions workflow.
|
|
@@ -45,10 +45,20 @@ export class ExpressionValue {
|
|
|
45
45
|
return __classPrivateFieldGet(this, _ExpressionValue_expression, "f");
|
|
46
46
|
}
|
|
47
47
|
equals(value) {
|
|
48
|
-
|
|
48
|
+
const sources = sourcesFrom(this);
|
|
49
|
+
if (isLiteralExpression(__classPrivateFieldGet(this, _ExpressionValue_expression, "f"))) {
|
|
50
|
+
const isEqual = __classPrivateFieldGet(this, _ExpressionValue_expression, "f") === formatLiteral(value);
|
|
51
|
+
return new RawCondition(isEqual ? "true" : "false", sources);
|
|
52
|
+
}
|
|
53
|
+
return new ComparisonCondition(__classPrivateFieldGet(this, _ExpressionValue_expression, "f"), "==", value, sources);
|
|
49
54
|
}
|
|
50
55
|
notEquals(value) {
|
|
51
|
-
|
|
56
|
+
const sources = sourcesFrom(this);
|
|
57
|
+
if (isLiteralExpression(__classPrivateFieldGet(this, _ExpressionValue_expression, "f"))) {
|
|
58
|
+
const isEqual = __classPrivateFieldGet(this, _ExpressionValue_expression, "f") === formatLiteral(value);
|
|
59
|
+
return new RawCondition(isEqual ? "false" : "true", sources);
|
|
60
|
+
}
|
|
61
|
+
return new ComparisonCondition(__classPrivateFieldGet(this, _ExpressionValue_expression, "f"), "!=", value, sources);
|
|
52
62
|
}
|
|
53
63
|
startsWith(prefix) {
|
|
54
64
|
return new FunctionCallCondition("startsWith", [__classPrivateFieldGet(this, _ExpressionValue_expression, "f"), formatLiteral(prefix)], sourcesFrom(this));
|
|
@@ -70,6 +80,13 @@ _ExpressionValue_expression = new WeakMap(), _ExpressionValue_allSources = new W
|
|
|
70
80
|
* `.not()` composition. Tracks all ExpressionSources referenced so that
|
|
71
81
|
* dependencies can be inferred automatically.
|
|
72
82
|
*/
|
|
83
|
+
// helpers for construction-time simplification
|
|
84
|
+
function isTrueCondition(c) {
|
|
85
|
+
return c instanceof RawCondition && c.toExpression() === "true";
|
|
86
|
+
}
|
|
87
|
+
function isFalseCondition(c) {
|
|
88
|
+
return c instanceof RawCondition && c.toExpression() === "false";
|
|
89
|
+
}
|
|
73
90
|
export class Condition {
|
|
74
91
|
constructor(sources) {
|
|
75
92
|
Object.defineProperty(this, "sources", {
|
|
@@ -81,18 +98,30 @@ export class Condition {
|
|
|
81
98
|
this.sources = sources;
|
|
82
99
|
}
|
|
83
100
|
and(other) {
|
|
84
|
-
|
|
101
|
+
const right = typeof other === "boolean"
|
|
102
|
+
? new RawCondition(String(other), EMPTY_SOURCES)
|
|
103
|
+
: other;
|
|
104
|
+
if (isTrueCondition(this))
|
|
105
|
+
return right;
|
|
106
|
+
if (isTrueCondition(right))
|
|
85
107
|
return this;
|
|
86
|
-
if (
|
|
87
|
-
return new RawCondition("false", this
|
|
88
|
-
|
|
108
|
+
if (isFalseCondition(this) || isFalseCondition(right)) {
|
|
109
|
+
return new RawCondition("false", unionSources(this, right));
|
|
110
|
+
}
|
|
111
|
+
return new LogicalCondition("&&", this, right, unionSources(this, right));
|
|
89
112
|
}
|
|
90
113
|
or(other) {
|
|
91
|
-
|
|
114
|
+
const right = typeof other === "boolean"
|
|
115
|
+
? new RawCondition(String(other), EMPTY_SOURCES)
|
|
116
|
+
: other;
|
|
117
|
+
if (isFalseCondition(this))
|
|
118
|
+
return right;
|
|
119
|
+
if (isFalseCondition(right))
|
|
92
120
|
return this;
|
|
93
|
-
if (
|
|
94
|
-
return new RawCondition("true", this
|
|
95
|
-
|
|
121
|
+
if (isTrueCondition(this) || isTrueCondition(right)) {
|
|
122
|
+
return new RawCondition("true", unionSources(this, right));
|
|
123
|
+
}
|
|
124
|
+
return new LogicalCondition("||", this, right, unionSources(this, right));
|
|
96
125
|
}
|
|
97
126
|
not() {
|
|
98
127
|
return new NotCondition(this, this.sources);
|
|
@@ -123,6 +152,10 @@ export class Condition {
|
|
|
123
152
|
flattenOr() {
|
|
124
153
|
return [this];
|
|
125
154
|
}
|
|
155
|
+
/** returns true if this condition always evaluates to true */
|
|
156
|
+
isAlwaysTrue() {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
126
159
|
/** render wrapped in `${{ }}` for YAML `if` fields */
|
|
127
160
|
toString() {
|
|
128
161
|
return `\${{ ${this.toExpression()} }}`;
|
|
@@ -244,6 +277,18 @@ export class RawCondition extends Condition {
|
|
|
244
277
|
_RawCondition_expression.set(this, void 0);
|
|
245
278
|
__classPrivateFieldSet(this, _RawCondition_expression, expression, "f");
|
|
246
279
|
}
|
|
280
|
+
isAlwaysTrue() {
|
|
281
|
+
return __classPrivateFieldGet(this, _RawCondition_expression, "f") === "true";
|
|
282
|
+
}
|
|
283
|
+
not() {
|
|
284
|
+
if (__classPrivateFieldGet(this, _RawCondition_expression, "f") === "true") {
|
|
285
|
+
return new RawCondition("false", this.sources);
|
|
286
|
+
}
|
|
287
|
+
if (__classPrivateFieldGet(this, _RawCondition_expression, "f") === "false") {
|
|
288
|
+
return new RawCondition("true", this.sources);
|
|
289
|
+
}
|
|
290
|
+
return super.not();
|
|
291
|
+
}
|
|
247
292
|
toExpression() {
|
|
248
293
|
return __classPrivateFieldGet(this, _RawCondition_expression, "f");
|
|
249
294
|
}
|
|
@@ -349,11 +394,37 @@ export const conditions = {
|
|
|
349
394
|
isRunnerArch: (arch) => expr("runner.arch").equals(arch),
|
|
350
395
|
};
|
|
351
396
|
// --- helpers ---
|
|
397
|
+
/** Checks if a condition-like value always evaluates to true. */
|
|
398
|
+
export function isAlwaysTrue(c) {
|
|
399
|
+
if (c instanceof Condition)
|
|
400
|
+
return c.isAlwaysTrue();
|
|
401
|
+
if (typeof c === "string")
|
|
402
|
+
return c === "true";
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
/** Checks if a condition-like value always evaluates to false. */
|
|
406
|
+
export function isAlwaysFalse(c) {
|
|
407
|
+
if (c instanceof Condition)
|
|
408
|
+
return isFalseCondition(c);
|
|
409
|
+
if (typeof c === "string")
|
|
410
|
+
return c === "false";
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
352
413
|
export function formatLiteral(value) {
|
|
353
414
|
if (typeof value === "string")
|
|
354
415
|
return `'${value}'`;
|
|
355
416
|
return String(value);
|
|
356
417
|
}
|
|
418
|
+
/** checks if an expression string is a literal (quoted string, number, or boolean) */
|
|
419
|
+
function isLiteralExpression(expr) {
|
|
420
|
+
if (expr.startsWith("'") && expr.endsWith("'"))
|
|
421
|
+
return true;
|
|
422
|
+
if (expr === "true" || expr === "false")
|
|
423
|
+
return true;
|
|
424
|
+
if (expr.length > 0 && String(Number(expr)) === expr)
|
|
425
|
+
return true;
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
357
428
|
export function sourcesFrom(...sourceables) {
|
|
358
429
|
const set = new Set();
|
|
359
430
|
for (const v of sourceables) {
|
|
@@ -470,3 +541,44 @@ export class ElseIfBuilder {
|
|
|
470
541
|
}
|
|
471
542
|
}
|
|
472
543
|
_ElseIfBuilder_branches = new WeakMap(), _ElseIfBuilder_sources = new WeakMap(), _ElseIfBuilder_condition = new WeakMap();
|
|
544
|
+
// --- inline value (serializes as plain value, not ${{ }}) ---
|
|
545
|
+
class InlineValue extends ExpressionValue {
|
|
546
|
+
constructor(value) {
|
|
547
|
+
super(typeof value === "string" ? `'${value}'` : String(value));
|
|
548
|
+
_InlineValue_plainValue.set(this, void 0);
|
|
549
|
+
__classPrivateFieldSet(this, _InlineValue_plainValue, String(value), "f");
|
|
550
|
+
}
|
|
551
|
+
toString() {
|
|
552
|
+
return __classPrivateFieldGet(this, _InlineValue_plainValue, "f");
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
_InlineValue_plainValue = new WeakMap();
|
|
556
|
+
/**
|
|
557
|
+
* Converts an object with plain values into an object with typed
|
|
558
|
+
* Condition/ExpressionValue properties. Booleans become Conditions,
|
|
559
|
+
* strings/numbers become ExpressionValues that serialize inline.
|
|
560
|
+
*/
|
|
561
|
+
export function defineExprObj(obj) {
|
|
562
|
+
const result = {};
|
|
563
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
564
|
+
if (value instanceof Condition) {
|
|
565
|
+
result[key] = value;
|
|
566
|
+
}
|
|
567
|
+
else if (value instanceof ExpressionValue) {
|
|
568
|
+
result[key] = value;
|
|
569
|
+
}
|
|
570
|
+
else if (typeof value === "boolean") {
|
|
571
|
+
result[key] = new RawCondition(String(value), EMPTY_SOURCES);
|
|
572
|
+
}
|
|
573
|
+
else if (typeof value === "string") {
|
|
574
|
+
result[key] = new InlineValue(value);
|
|
575
|
+
}
|
|
576
|
+
else if (typeof value === "number") {
|
|
577
|
+
result[key] = new InlineValue(value);
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
throw new Error(`Unsupported value type for key "${key}"`);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return result;
|
|
584
|
+
}
|
package/esm/job.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,eAAe,
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAGhB,IAAI,EACJ,KAAK,QAAQ,EAId,MAAM,WAAW,CAAC;AAEnB,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IAChC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,MAAM,WAAW,gBAAgB;IAC/B,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AE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAUnD"}
|
package/esm/job.js
CHANGED
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _Job_instances, _Job_id, _Job_config, _Job_leafItems, _Job_outputDefs, _Job_cachedGraph, _Job_cachedLeafSteps, _Job_buildGraph;
|
|
13
|
-
import { Condition, ExpressionValue, } from "./expression.js";
|
|
13
|
+
import { Condition, ExpressionValue, isAlwaysFalse, isAlwaysTrue, } from "./expression.js";
|
|
14
14
|
import { Matrix } from "./matrix.js";
|
|
15
15
|
import { serializeConditionLike, serializeConfigValues, Step, StepRef, toCondition, unwrapSteps, } from "./step.js";
|
|
16
16
|
function ensureEntry(graph, step) {
|
|
@@ -322,7 +322,7 @@ export class Job {
|
|
|
322
322
|
if (needs.length > 0) {
|
|
323
323
|
result.needs = needs.map((j) => j.id);
|
|
324
324
|
}
|
|
325
|
-
if (config.if != null) {
|
|
325
|
+
if (config.if != null && !isAlwaysTrue(config.if)) {
|
|
326
326
|
result.if = serializeConditionLike(config.if);
|
|
327
327
|
}
|
|
328
328
|
if ("uses" in config) {
|
|
@@ -430,9 +430,12 @@ export class Job {
|
|
|
430
430
|
const { graph } = __classPrivateFieldGet(this, _Job_instances, "m", _Job_buildGraph).call(this);
|
|
431
431
|
const resolvedSteps = this.resolveSteps();
|
|
432
432
|
const effectiveConditions = computeEffectiveConditions(resolvedSteps, graph);
|
|
433
|
-
result.steps = resolvedSteps
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
result.steps = resolvedSteps
|
|
434
|
+
.filter((s) => {
|
|
435
|
+
const cond = effectiveConditions.get(s);
|
|
436
|
+
return cond == null || !isAlwaysFalse(cond);
|
|
437
|
+
})
|
|
438
|
+
.map((s) => s.toYaml(effectiveConditions.get(s)));
|
|
436
439
|
return result;
|
|
437
440
|
}
|
|
438
441
|
}
|
package/esm/mod.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { Job, job } from "./job.js";
|
|
|
5
5
|
export type { JobConfig, JobDef, ReusableJobConfig, ReusableJobDef, ServiceContainer, StepsJobConfig, StepsJobDef, } from "./job.js";
|
|
6
6
|
export { createWorkflow, isLinting, Workflow } from "./workflow.js";
|
|
7
7
|
export type { WorkflowCallInput, WorkflowCallOutput, WorkflowCallSecret, WorkflowCallTrigger, WorkflowConfig, WorkflowTriggers, } from "./workflow.js";
|
|
8
|
-
export { Condition, conditions, ElseIfBuilder, expr, ExpressionValue, ThenBuilder, } from "./expression.js";
|
|
9
|
-
export type { ExpressionSource, TernaryValue } from "./expression.js";
|
|
8
|
+
export { Condition, conditions, defineExprObj, ElseIfBuilder, expr, ExpressionValue, ThenBuilder, } from "./expression.js";
|
|
9
|
+
export type { ExpressionSource, ExprMap, ExprOf, TernaryValue, } from "./expression.js";
|
|
10
10
|
export { defineMatrix, Matrix } from "./matrix.js";
|
|
11
11
|
export type { PermissionLevel, Permissions, PermissionScope, } from "./permissions.js";
|
|
12
12
|
export { Artifact, defineArtifact } from "./artifact.js";
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,YAAY,EACV,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAA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ACnD,YAAY,EACV,eAAe,EACf,WAAW,EACX,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,eAAe,CAAC"}
|
package/esm/mod.js
CHANGED
|
@@ -2,6 +2,6 @@ import "./_dnt.polyfills.js";
|
|
|
2
2
|
export { Step, step, StepRef } from "./step.js";
|
|
3
3
|
export { Job, job } from "./job.js";
|
|
4
4
|
export { createWorkflow, isLinting, Workflow } from "./workflow.js";
|
|
5
|
-
export { Condition, conditions, ElseIfBuilder, expr, ExpressionValue, ThenBuilder, } from "./expression.js";
|
|
5
|
+
export { Condition, conditions, defineExprObj, ElseIfBuilder, expr, ExpressionValue, ThenBuilder, } from "./expression.js";
|
|
6
6
|
export { defineMatrix, Matrix } from "./matrix.js";
|
|
7
7
|
export { Artifact, defineArtifact } from "./artifact.js";
|
package/esm/step.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../src/step.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,eAAe,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../src/step.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC;AAEtE,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,EAAE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M,GAAG,MAAM,GAAG,OAAO,CAAC,CAM3C;AAID,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAE7E;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAM1D"}
|
package/esm/step.js
CHANGED
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _Step_id;
|
|
13
|
-
import { Condition, ExpressionValue, RawCondition, sourcesFrom, } from "./expression.js";
|
|
13
|
+
import { Condition, ExpressionValue, isAlwaysTrue, RawCondition, sourcesFrom, } from "./expression.js";
|
|
14
14
|
let stepCounter = 0;
|
|
15
15
|
// exported for testing only
|
|
16
16
|
export function resetStepCounter() {
|
|
@@ -99,7 +99,7 @@ export class Step {
|
|
|
99
99
|
result.uses = this.config.uses;
|
|
100
100
|
}
|
|
101
101
|
const ifCondition = effectiveIf ?? this.config.if;
|
|
102
|
-
if (ifCondition != null) {
|
|
102
|
+
if (ifCondition != null && !isAlwaysTrue(ifCondition)) {
|
|
103
103
|
result.if = serializeConditionLike(ifCondition);
|
|
104
104
|
}
|
|
105
105
|
if (this.config.shell != null) {
|