Is it possible to use ES6 style modules when writing custom actions? I am getting all sorts of issues when trying to use them. In the unbundle form (regulard js wiht node_modules committed) I get this error:
SyntaxError: Cannot use import statement outside a module
while in the compiled (bundled) form I get in turn these errors:
(node:6304) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'info' of undefined
This one specifically on imported @actions/core
. Plus in the compiled form there are bunch of requires
as well and node.js (rightly) complains about mixing import
and requires
.
So neither way of doing actions supported by GitHub allow ES6 modules it seems. How are the actions called anyway? When I call node main.js
locally it works without problems in either form.