Fix "disable-empty-commits"#82
Merged
Andrew-Chen-Wang merged 1 commit intoJun 29, 2025
Merged
Conversation
The action would still exit with a failure, even when the exception was supposed to be caught. A strategically place `console.log(e, JSON.stringify(e));` shows that the error message doesn't actually go to `stderr`, but to `stdout`, so now things should work correctly.
Andrew-Chen-Wang
approved these changes
Jun 29, 2025
| await $`git commit -m ${core.getInput("commit_message")}`; | ||
| } catch (e) { | ||
| if (e.exitCode === 1 && e.stderr.includes("nothing to commit")) { | ||
| if (e.exitCode === 1 && e.stdout.includes("nothing to commit")) { |
Owner
|
Let me know if this is ready to be merged. Thanks for the contributions |
Contributor
Author
|
@Andrew-Chen-Wang I think it is ready for merge. I ran quite some tests in my own fork and believe this fixes the action always exiting with 1 for skipped commits. |
2c80c13
into
Andrew-Chen-Wang:master
0 of 13 checks passed
Owner
|
Thanks, just released 5.0.1. Please try it out @jrfnl |
Contributor
Author
|
Thanks @Andrew-Chen-Wang! I've done some more testing and all seems to be good now. I do still see an |
Owner
|
Thank you @jrfnl I've been very busy recently so I appreciate your contributions greatly |
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.
Follow up on #81
The action would still exit with a failure, even when the exception was supposed to be caught.
A strategically placed
console.log(e, JSON.stringify(e));shows that the error message doesn't actually go tostderr, but tostdout, so now things should work correctly.