Skip to content

Commit de24249

Browse files
authored
fix(job): Allow timeout-minutes to be specified as an expression (#33)
1 parent 71b9639 commit de24249

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/package/job.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ describe("Job", () => {
3838
steps: [],
3939
},
4040
],
41+
[
42+
new Job("test", {
43+
runsOn: "ubuntu-latest",
44+
timeoutMinutes: "${{ foo }}",
45+
}),
46+
{
47+
"runs-on": "ubuntu-latest",
48+
"timeout-minutes": "${{ foo }}",
49+
steps: [],
50+
},
51+
],
4152
[
4253
new Job("test", {
4354
runsOn: "ubuntu-latest",

lib/package/job.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import type { Expression } from "./expression";
12
import { type Permissions, permissionsJSON } from "./permissions";
23
import { type RunStep, type Step, stepJSON, type UsesStep } from "./step";
34

45
export type JobConfig = {
56
runsOn: string;
67
permissions?: Permissions;
7-
timeoutMinutes?: number;
8+
timeoutMinutes?: number | Expression;
89
outputs?: Record<string, string>;
910
needs?: string | string[];
1011
if?: string | boolean | number;

0 commit comments

Comments
 (0)