Skip to content

Fix "disable-empty-commits"#82

Merged
Andrew-Chen-Wang merged 1 commit into
Andrew-Chen-Wang:masterfrom
jrfnl:feature/fix-disable-empty-commits
Jun 29, 2025
Merged

Fix "disable-empty-commits"#82
Andrew-Chen-Wang merged 1 commit into
Andrew-Chen-Wang:masterfrom
jrfnl:feature/fix-disable-empty-commits

Conversation

@jrfnl
Copy link
Copy Markdown
Contributor

@jrfnl jrfnl commented Jun 29, 2025

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 to stderr, but to stdout, so now things should work correctly.

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.
Comment thread cli.ts
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")) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Andrew-Chen-Wang
Copy link
Copy Markdown
Owner

Let me know if this is ready to be merged. Thanks for the contributions

@jrfnl
Copy link
Copy Markdown
Contributor Author

jrfnl commented Jun 29, 2025

@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.

@Andrew-Chen-Wang Andrew-Chen-Wang merged commit 2c80c13 into Andrew-Chen-Wang:master Jun 29, 2025
0 of 13 checks passed
@jrfnl jrfnl deleted the feature/fix-disable-empty-commits branch June 29, 2025 17:40
@Andrew-Chen-Wang
Copy link
Copy Markdown
Owner

Thanks, just released 5.0.1. Please try it out @jrfnl

@jrfnl
Copy link
Copy Markdown
Contributor Author

jrfnl commented Jul 1, 2025

Thanks @Andrew-Chen-Wang! I've done some more testing and all seems to be good now.

I do still see an Uncaught Error: Assertion failed as the bottom of the transscript, but I believe that was already there and is unrelated to this PR. Might have a look to fix that when I have some time.

@Andrew-Chen-Wang
Copy link
Copy Markdown
Owner

Thank you @jrfnl I've been very busy recently so I appreciate your contributions greatly

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