Ensure inputs is defined
This commit is contained in:
@@ -240,4 +240,26 @@ jobs:
|
|||||||
|
|
||||||
expect(result.map(x => x.label)).toEqual(["another-name", "name"]);
|
expect(result.map(x => x.label)).toEqual(["another-name", "name"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("no inputs", async () => {
|
||||||
|
const input = `
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
a:
|
||||||
|
outputs:
|
||||||
|
build_id: my-build-id
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo hello a
|
||||||
|
b:
|
||||||
|
needs: [a]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "hello \${{ inputs.|
|
||||||
|
`;
|
||||||
|
const result = await complete(...getPositionFromCursor(input), undefined, contextProviderConfig);
|
||||||
|
|
||||||
|
expect(result).toEqual([]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ export function getInputsContext(workflowContext: WorkflowContext): data.Diction
|
|||||||
}
|
}
|
||||||
|
|
||||||
const inputs = event.inputs;
|
const inputs = event.inputs;
|
||||||
|
if (!inputs) {
|
||||||
|
return d;
|
||||||
|
}
|
||||||
for (const inputName of Object.keys(inputs)) {
|
for (const inputName of Object.keys(inputs)) {
|
||||||
const input = inputs[inputName];
|
const input = inputs[inputName];
|
||||||
switch (input.type) {
|
switch (input.type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user