-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make require relative to GitHub workspace #116
Make require relative to GitHub workspace #116
Conversation
78916ad
to
076d4a8
Compare
@robyoung could this break existing uses of this action that assume the require isn't relative? |
Not that I can think of if they assume the require isn't relative. If an absolute path is provided it still works as expected because in those cases the current working directory is irrelevant. Uses that depend on whatever the current working directory is now would break (assuming that is different to |
@joshmgross is there anything else you need before this can be merged? |
👋 Hey @robyoung, sorry for the delay. I'll try to test this out next week and get it merged. |
Change to the GITHUB_WORKSPACE directory before running the script so that callers do not have to exlicitly use the GITHUB_WORKSPACE environment variable when requiring script files. Workflow run steps are run within the GITHUB_WORKSPACE so this seems like the expected default.
This is a non breaking change as the documented approach still works as expected.
076d4a8
to
3d4b500
Compare
Just rebased to resolve a conflict with the updated version. Any idea when this may get reviewed @joshmgross |
👋 Hey @robyoung, apologies again for the delay. The changes look good to me but I need to run through a few test scenarios to make sure we're not breaking any existing uses. |
Unfortunately, relative requires not working isn't because of the working directory (actions run by default in the This is why although tests pass in this fork, calls to I'm going to close this issue, but @robyoung please feel free to follow up if you have any other questions! |
#135 should fix this Edit: Published in V4 https://github.com/actions/github-script/releases/tag/v4.0.0 |
Change to the
GITHUB_WORKSPACE
directory before running the script so that callers do not have to explicitly use theGITHUB_WORKSPACE
environment variable when requiring script files.Workflow run steps are run within the GITHUB_WORKSPACE so this seems like the expected default.