github-contribution-graph-action icon indicating copy to clipboard operation
github-contribution-graph-action copied to clipboard

Add: error handling to Git actions

Open amanchauhann opened this issue 1 year ago • 0 comments

I made the following changes to the code:

  1. Wrapped the entire code in a try-catch block to handle any unexpected errors that might occur during execution.
  2. Added error handling for each asynchronous function call, by wrapping them in their respective try-catch blocks.
  3. Added error handling for the case where the GIT_SSH_COMMAND environment variable is not defined.

To confirm:

  1. Set an invalid GIT_HOST environment variable and confirm that the code throws an error.
  2. Set INCLUDE_WEEKENDS environment variable to false and confirm that no commits are made on weekends.
  3. Set INCLUDE_WEEKDAYS environment variable to false and confirm that no commits are made on weekdays.
  4. Set MIN_COMMITS_PER_DAY and MAX_COMMITS_PER_DAY environment variables to values less than or greater than one and confirm that the number of commits made on each day is within the specified range.

The code logs a success message for each commit made.

amanchauhann avatar Apr 15 '23 20:04 amanchauhann