Skip to content

Commit f6df48c

Browse files
committed
[eas-cli] Validate legacy command/path local functions referenced from workflows
1 parent 5b53032 commit f6df48c

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This is the log of notable changes to EAS CLI and related packages.
1010

1111
- [build-tools] Set the artifact kind for Argent session artifacts from the MIME type reported by the tool server, so screenshots and screen recordings are grouped and labelled on the simulator session page instead of appearing in an unclassified file list. ([#4154](https://github.com/expo/eas-cli/pull/4154) by [@szdziedzic](https://github.com/szdziedzic))
1212
- [build-tools] Load local functions declaring `command` or `path`, so custom build functions moved from `.eas/build` configs into `.eas/functions` can be called from workflows. ([#4096](https://github.com/expo/eas-cli/pull/4096) by [@sswrk](https://github.com/sswrk))
13+
- [eas-cli] Validate local functions declaring `command` or `path` referenced from workflows, including that the module directory of a `path` function exists. ([#4098](https://github.com/expo/eas-cli/pull/4098) by [@sswrk](https://github.com/sswrk))
1314

1415
### 🐛 Bug fixes
1516

packages/eas-cli/src/commandUtils/workflow/__tests__/localFunctions-test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,24 @@ describe(validateWorkflowLocalFunctionsAsync, () => {
271271
validateWorkflowLocalFunctionsAsync(workflow, projectDir)
272272
).resolves.toBeUndefined();
273273
});
274+
275+
it('validates a referenced single-step command function', async () => {
276+
const projectRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'eas-workflow-functions-command-'));
277+
await makeProjectWithCompositeFunctionAsync(
278+
projectRoot,
279+
'say-hi',
280+
['inputs:', ' - name', 'command: echo "Hi, ${ inputs.name }!"'].join('\n')
281+
);
282+
const workflow = {
283+
jobs: {
284+
job: {
285+
steps: [{ uses: './.eas/functions/say-hi', with: { name: 'World' } }],
286+
},
287+
},
288+
};
289+
290+
await expect(
291+
validateWorkflowLocalFunctionsAsync(workflow, projectRoot)
292+
).resolves.toBeUndefined();
293+
});
274294
});

0 commit comments

Comments
 (0)