Skip to content

Conversation

@GrantBirki
Copy link
Owner

@GrantBirki GrantBirki commented Mar 19, 2024

Updates to examples:

  • README.md: Upgraded the version of actions/checkout used in the examples from v3 to v4. [1] [2]

Addition of new input options:

  • README.md: Added git_options and git_diff_file to the list of input options.
  • action.yml: Added git_options and git_diff_file as new input options for the action.

Modifications to the gitDiff function and its related tests:

  • __tests__/main.test.js: Updated the tests for the gitDiff function to reflect the changes in its implementation.

  • src/functions/git-diff.js: Modified the gitDiff function to support the new git_options and git_diff_file input 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 the run function to await the gitDiff function.Changes to the gitDiff function:

  • src/functions/git-diff.js: The gitDiff function is now an asynchronous function that uses promisify from the util module to convert exec to a promise-based function. This change allows us to use await to wait for the execAsync function to complete before proceeding.

  • src/functions/git-diff.js: The gitDiff function now accepts git_options as an input, which are passed to the git diff command. 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 the gitDiff function to provide information about the total number of files changed in the raw diff and the JSON diff. [1] [2]

Addition of git_options input parameter:

  • README.md: Added documentation for the new git_options input parameter.
  • __tests__/main.test.js: Added a new environment variable for git_options in the beforeEach function.
  • action.yml: Added a new git_options input parameter with a default value of "--no-color --full-index".

Other changes:

  • src/main.js: The run function now awaits the gitDiff function to ensure it completes before proceeding.

@GrantBirki GrantBirki merged commit 999b996 into main Mar 19, 2024
@GrantBirki GrantBirki deleted the git-diff-improvements branch March 19, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants