Ideally, danger should evaluate an external Dangerfile as if it lived within the project directory from which danger was invoked. Alternatively, it would be desirable to have a command-line parameter that lets me specify the directory that danger considers to be the project directory.
NOTE: danger.import_dangerfile seemed like it might be a solution for this problem, but I could not get it to work from within danger-js. The documentation is pretty sparse and unclear, so I'm not sure if I was doing something wrong.
What happened instead?
Danger was not able to see the node_modules in the directory from which I invoked danger:
Running Danger in project
[Function: arrayFirst]
[Function: last]
Danger: ✓ passed review, received no feedback.
Running Danger in project, using external Dangerfile
ERROR { Error: Cannot find module 'array-first'
Your Environment
Which CI are you running on? local
Are you running the latest version of Danger? 9.2.8
Report
What did you do?
I invoked
npx danger local
within a Node.js project, specifying adangerfile.js
that lives outside of the project.Reproduction case:
What did you expect to happen?
Ideally,
danger
should evaluate an external Dangerfile as if it lived within the project directory from whichdanger
was invoked. Alternatively, it would be desirable to have a command-line parameter that lets me specify the directory thatdanger
considers to be the project directory.NOTE:
danger.import_dangerfile
seemed like it might be a solution for this problem, but I could not get it to work from within danger-js. The documentation is pretty sparse and unclear, so I'm not sure if I was doing something wrong.What happened instead?
Danger was not able to see the
node_modules
in the directory from which I invokeddanger
:Your Environment