Skip to content

Report failed commits in changeset add - #2340

Open
kerdofficial wants to merge 1 commit into
changesets:mainfrom
kerdofficial:fix/1326-add-commit-failure
Open

kerdofficial wants to merge 1 commit into
changesets:mainfrom
kerdofficial:fix/1326-add-commit-failure

Conversation

@kerdofficial

Copy link
Copy Markdown

Fixes #1326

With commit enabled, changeset add ignored the result of git.commit() and always printed "Changeset added and committed!", even when the commit failed (for example because of a pre-commit hook).

It now logs the same error version uses ("Changesets ran into trouble committing your files") and falls back to "Changeset added - you can now commit it!". The changeset file is kept either way.

This is close to #2299, which was closed without being merged. #1320 adds stderr output to the git helper but does not change this message.

Added a test with git.commit mocked to return false; it fails without the change. types:check, lint, format and the cli tests pass.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6f525db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for changesets ready!

Name Link
🔨 Latest commit 6f525db
🔍 Latest deploy log https://app.netlify.com/projects/changesets/deploys/6ad4c58b7e955c3a58f0ee89
😎 Deploy Preview https://deploy-preview-2340--changesets.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.50%. Comparing base (e2ee472) to head (6f525db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2340      +/-   ##
==========================================
+ Coverage   87.48%   87.50%   +0.01%     
==========================================
  Files          78       78              
  Lines        2973     2977       +4     
  Branches      851      855       +4     
==========================================
+ Hits         2601     2605       +4     
  Misses        337      337              
  Partials       35       35              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

changeset add is ignoring the exit code of git commit

1 participant