Support reusable workflow outputs in expressions
This commit is contained in:
@@ -68,6 +68,25 @@ jobs:
|
||||
`
|
||||
};
|
||||
|
||||
case "./reusable-workflow-with-outputs.yaml":
|
||||
return {
|
||||
name: "reusable-workflow-with-outputs.yaml",
|
||||
content: `
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
build_id:
|
||||
description: 'The resulting build ID'
|
||||
value: 123
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
`
|
||||
};
|
||||
|
||||
default:
|
||||
throw new Error("File not found");
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import {getWorkflowContext, WorkflowContext} from "../context/workflow-context";
|
||||
import {nullTrace} from "../nulltrace";
|
||||
import {findToken} from "../utils/find-token";
|
||||
import {getPositionFromCursor} from "./cursor-position";
|
||||
import {testFileProvider} from "./test-file-provider";
|
||||
|
||||
export async function testGetWorkflowContext(input: string): Promise<WorkflowContext> {
|
||||
const [textDocument, pos] = getPositionFromCursor(input);
|
||||
@@ -17,7 +18,9 @@ export async function testGetWorkflowContext(input: string): Promise<WorkflowCon
|
||||
let template: WorkflowTemplate | undefined;
|
||||
|
||||
if (result.value) {
|
||||
template = await convertWorkflowTemplate(result.context, result.value);
|
||||
template = await convertWorkflowTemplate(result.context, result.value, undefined, testFileProvider, {
|
||||
fetchReusableWorkflowDepth: 1
|
||||
});
|
||||
}
|
||||
|
||||
const {path} = findToken(pos, result.value);
|
||||
|
||||
Reference in New Issue
Block a user