Git diff improvements #26
Merged
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.
Updates to examples:
README.md: Upgraded the version ofactions/checkoutused in the examples from v3 to v4. [1] [2]Addition of new input options:
README.md: Addedgit_optionsandgit_diff_fileto the list of input options.action.yml: Addedgit_optionsandgit_diff_fileas new input options for the action.Modifications to the
gitDifffunction and its related tests:__tests__/main.test.js: Updated the tests for thegitDifffunction to reflect the changes in its implementation.src/functions/git-diff.js: Modified thegitDifffunction to support the newgit_optionsandgit_diff_fileinput options. The function can now read the diff from a file and pass additional options to the git binary. [1] [2] [3] [4]src/main.js: Updated therunfunction to await thegitDifffunction.Changes to thegitDifffunction:src/functions/git-diff.js: ThegitDifffunction is now an asynchronous function that usespromisifyfrom theutilmodule to convertexecto a promise-based function. This change allows us to useawaitto wait for theexecAsyncfunction to complete before proceeding.src/functions/git-diff.js: ThegitDifffunction now acceptsgit_optionsas an input, which are passed to thegit diffcommand. This change allows users to specify additional options for the git binary. [1] [2]src/functions/git-diff.js: Additional logging has been added to thegitDifffunction to provide information about the total number of files changed in the raw diff and the JSON diff. [1] [2]Addition of
git_optionsinput parameter:README.md: Added documentation for the newgit_optionsinput parameter.__tests__/main.test.js: Added a new environment variable forgit_optionsin thebeforeEachfunction.action.yml: Added a newgit_optionsinput parameter with a default value of"--no-color --full-index".Other changes:
src/main.js: Therunfunction now awaits thegitDifffunction to ensure it completes before proceeding.