feat: add working-directory input to change script execution directory#720
Open
mturac wants to merge 2 commits into
Open
feat: add working-directory input to change script execution directory#720mturac wants to merge 2 commits into
mturac wants to merge 2 commits into
Conversation
- Add working-directory input to action.yml - Implement process.chdir() in main.ts before script execution - Users can now specify working directory without modifying scripts Closes actions#426
- Add src/working-directory.ts with validateWorkingDirectory() - Add __test__/working-directory.test.ts with 4 test cases - Update main.ts to use validation function - Throw clear error for non-existent or non-directory paths - Rebuild dist/index.js Addresses review feedback on actions#426
2cc5e9b to
7b9b30a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! 👋
This PR adds a
working-directoryinput to github-script, similar to howrunsteps supportworking-directoryin GitHub Actions.The Problem
Before this change, if you wanted your script to run in a different directory, you had to manually call
process.chdir()in your script. This is:The Solution
Now you can simply specify the working directory:
What Changed
working-directoryinput toaction.ymlprocess.chdir()call inmain.tsbefore script executionTesting
All existing tests pass, and new tests were added for the working-directory feature.
Closes #426