Skip to content

Commit 2c80c13

Browse files
authored
Fix "disable-empty-commits" (#82)
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. Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
1 parent 7ee32e8 commit 2c80c13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if (core.getBooleanInput("disable_empty_commits")) {
9696
try {
9797
await $`git commit -m ${core.getInput("commit_message")}`;
9898
} catch (e) {
99-
if (e.exitCode === 1 && e.stderr.includes("nothing to commit")) {
99+
if (e.exitCode === 1 && e.stdout.includes("nothing to commit")) {
100100
console.log("nothing to commit, working tree clean");
101101
} else {
102102
throw e; // Unexpected error

0 commit comments

Comments
 (0)