We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 603f57f commit 303912dCopy full SHA for 303912d
lib/package/step.spec.ts
@@ -32,6 +32,10 @@ describe("stepJSON", () => {
32
{ kind: "run", shell: "bash", command: "echo 'Hello, world!'" },
33
{ shell: "bash", run: "echo 'Hello, world!'" },
34
],
35
+ [
36
+ { kind: "run", if: "always()", command: "echo 'Hello, world!'" },
37
+ { if: "always()", run: "echo 'Hello, world!'" },
38
+ ],
39
])("stepJSON(%j) -> %j", (input, expected) => {
40
expect(stepJSON(input)).toEqual(expected);
41
});
@@ -63,6 +67,10 @@ describe("stepJSON", () => {
63
67
{ kind: "uses", name: "test", action: "actions/checkout@v4" },
64
68
{ name: "test", uses: "actions/checkout@v4" },
65
69
70
71
+ { kind: "uses", if: "always()", action: "actions/checkout@v4" },
72
+ { if: "always()", uses: "actions/checkout@v4" },
73
66
74
75
76
lib/package/step.ts
@@ -4,7 +4,7 @@ export type StepBase = {
4
id?: string;
5
name?: string;
6
env?: Record<string, string>;
7
- // TODO: if
+ if?: string | boolean | number;
8
// TODO: continue-on-error
9
// TODO: timeout-minutes
10
};
@@ -29,6 +29,7 @@ export function stepJSON(step: Step): Record<string, unknown> {
29
...(step.id != null && { id: step.id }),
30
...(step.name != null && { name: step.name }),
31
...(step.env != null && { env: step.env }),
+ ...(step.if != null && { if: step.if }),
switch (step.kind) {
0 commit comments