Open schazza opened 6 months ago
As noted by the changelog for 7.20.0, there was added support for actions code files to be imported relative to the configuration file (#866). There must've been a regression included in that.
Looking closer, there is a loadFile
function that allows for an absolute path or a path relative to the actions folder. The code that was added in #866 only accounts for the latter of the cases, which may explain this bug. Especially since you nest the config file in a config
directory. I'm unable to recreate your specific issue, can you provide the action configuration file and the path of the exported code.js
file?
Thanks for a fast response.
We have three actions that all look roughly like this:
{
"name": "Add roles to ID token",
"code": "code.js",
"runtime": "node18",
"status": "built",
"dependencies": [],
"secrets": [],
"supported_triggers": [
{
"id": "post-login",
"version": "v2"
}
],
"deployed": true
}
Path to the action configuration file is C:\Git\auth0-cicd\src\actions\Add roles to ID token.json
Path to the code.js file is C:\Git\auth0-cicd\src\actions\Add roles to ID token\code.js
We set this up following this example: https://github.com/auth0/auth0-deploy-cli/tree/master/examples/directory/actions
Checklist
Description
Since updating to 7.20.0 I get the following error when trying to import (
a0deploy import --input_file ./src --config_file ./config/config-file.json
): Unable to load file C:\Git\auth0-cicd\src\code.js due to Error: ENOENT: no such file or directory, access 'C:\Git\auth0-cicd\src\code.js'Expectation
The import should work with this command without a code.js file in the src folder. Alternatively if this file is required some information on what it should include should have been added in the release notes for 7.20.0.
Reproduction
Deploy CLI version
7.20.0
Node version
18.17.1