Treat no-op git commit (nothing to commit) as a skip, not a failure - #26
Merged
neilvcarvalho merged 1 commit intoAug 3, 2026
Conversation
neilvcarvalho
approved these changes
Aug 3, 2026
Member
|
Thank you! We plan to release this action in the GitHub Marketplace and in the thoughtbot blog in the next few days, wrapping up a 1.0 version. I failed to find a project using importmap extensively after I left my previous project and ended up not touching this action (also some long PTO). I appreciate you using it, finding bugs and opening PRs to fix them. |
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.
Problem
The action failed on repos where
bin/importmap pinproduced no changes,with all planned PRs reporting a hard failure:
Root cause
When
bin/importmap pin <pkg>@<version>results in no diff (the packageis already at that version),
git commitexits with code 1 and writes:That message is emitted on stdout, not stderr. But
GitClient#commit_changesonly inspectede.result.stderrto detectthis benign case:
Since
stderrwas empty, the check never matched, the error wasre-raised, and the action exited 1 — even though there was nothing
wrong, just nothing to commit.
Fix
lib/git_client.rbnow checks both stdout and stderr for the"nothing to commit" marker, so a no-op pin is correctly treated as a
skip ("No changes after pinning") instead of a failure.
Test plan
covering the real git behavior (message on stdout, empty stderr).