Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languageservice/src/complete.expressions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ jobs:
`;

const result = await complete(...getPositionFromCursor(input), {contextProviderConfig});
expect(result.map(x => x.label)).toEqual(["container", "services", "status"]);
expect(result.map(x => x.label)).toEqual(["check_run_id", "container", "services", "status"]);
});

it("job context is suggested within a job output", async () => {
Expand Down
3 changes: 3 additions & 0 deletions languageservice/src/context-providers/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export function getJobContext(workflowContext: WorkflowContext): DescriptionDict
// Status
jobContext.add("status", new data.Null());

// Check run ID
jobContext.add("check_run_id", new data.Null());

return jobContext;
}

Expand Down
15 changes: 15 additions & 0 deletions languageservice/src/validate.expressions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,21 @@ jobs:
expect(result).toEqual([]);
});

it("job.check_run_id", async () => {
const input = `
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo \${{ job.check_run_id }}
`;
const result = await validate(createDocument("wf.yaml", input));

expect(result).toEqual([]);
});

it("job.services.<service_id>", async () => {
const input = `
on: push
Expand Down