actions / github-script

Write workflows scripting the GitHub API in JavaScript
MIT License
4.24k stars 424 forks source link

Add `.github/workflows` path to `require` paths #430

Open andrewvaughan opened 1 year ago

andrewvaughan commented 1 year ago

Is your feature request related to a problem? Please describe. It took me a while to figure out how to include files in this project, because I had (incorrectly) assumed the relative path was to the .github/workflows folder and not the project root. I would assume this is a common misunderstanding, as the user is writing their script inside that folder.

Describe the solution you'd like I certainly don't recommend changing the behavior, but simply adding the workflow's .github/workflows path in the list of paths for require to search.

Describe alternatives you've considered Alternatively, make a way for users to add their own relative paths to the configuration or the script, which might be a better approach.

It seems of the two common ways of doing this (namely, modifying the process.env.NODE_PATH environment variable or pushing a path onto module.paths), neither is implemented. The easiest method might be to simply make use of the process.env.NODE_PATH environment variable as the core functionality does.

Additional context N/A