github-contribution-graph-action
github-contribution-graph-action copied to clipboard
Add: error handling to Git actions
I made the following changes to the code:
- Wrapped the entire code in a try-catch block to handle any unexpected errors that might occur during execution.
- Added error handling for each asynchronous function call, by wrapping them in their respective try-catch blocks.
- Added error handling for the case where the GIT_SSH_COMMAND environment variable is not defined.
To confirm:
- Set an invalid GIT_HOST environment variable and confirm that the code throws an error.
- Set INCLUDE_WEEKENDS environment variable to false and confirm that no commits are made on weekends.
- Set INCLUDE_WEEKDAYS environment variable to false and confirm that no commits are made on weekdays.
- 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.