Skip to content

ci(bump): gracefully handle no bump-eligible commits#1950

Merged
bearomorphism merged 1 commit intomasterfrom
ci/fix-bumpversion-no-commits
May 8, 2026
Merged

ci(bump): gracefully handle no bump-eligible commits#1950
bearomorphism merged 1 commit intomasterfrom
ci/fix-bumpversion-no-commits

Conversation

@bearomorphism
Copy link
Copy Markdown
Collaborator

@bearomorphism bearomorphism commented May 8, 2026

Description

When non-bump-eligible commits (e.g. docs:, ci:, build(deps):) are pushed to master, cz bump --yes exits with code 21 (NO_COMMITS_TO_BUMP), causing the bump workflow to fail.

Out of the last 20 runs, ~12 failed this way — see recent example.

This PR handles exit code 21 explicitly: log a message, set bumped=false, and exit 0. The Build changelog and Release steps are now conditional on bumped == 'true'. All other non-zero exit codes still fail the workflow as before.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-by: GitHub Copilot following the guidelines

Code Changes

  • This is a CI-only change (no code changes, no tests needed)
  • Manually test the changes:
    • Verified by reviewing recent workflow run logs — exit code 21 is the sole cause of these failures
    • Backward compatible — real bumps (exit code 0) and actual errors (other exit codes) behave identically

Documentation Changes

N/A — CI workflow only.

Expected Behavior

When commits like docs:, ci:, or build(deps): are pushed to master, the bump workflow should succeed gracefully (with a "No bump-eligible commits found" message) instead of failing with exit code 21.

Steps to Test This Pull Request

  1. Push a docs: or ci: commit to master
  2. Observe the bump workflow succeeds and skips the changelog/release steps

Additional Context

Related workflow: .github/workflows/bumpversion.yml

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (efb1a7d) to head (e483556).
⚠️ Report is 8 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1950   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files          61       61           
  Lines        2772     2772           
=======================================
  Hits         2723     2723           
  Misses         49       49           

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

@bearomorphism bearomorphism force-pushed the ci/fix-bumpversion-no-commits branch from ca48e4b to 1f395a7 Compare May 8, 2026 06:43
When commits like docs:, ci:, or build(deps): are pushed to master,
cz bump exits with code 21 (NO_COMMITS_TO_BUMP), failing the workflow.

Handle exit code 21 explicitly by setting bumped=false and exiting 0.
Subsequent changelog and release steps are now conditional on
bumped == 'true', so they are skipped when there is nothing to release.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bearomorphism bearomorphism force-pushed the ci/fix-bumpversion-no-commits branch from 1f395a7 to e483556 Compare May 8, 2026 06:44
@bearomorphism bearomorphism marked this pull request as ready for review May 8, 2026 06:45
@bearomorphism bearomorphism merged commit 5513e01 into master May 8, 2026
20 checks passed
@bearomorphism bearomorphism deleted the ci/fix-bumpversion-no-commits branch May 8, 2026 07:10
@woile
Copy link
Copy Markdown
Member

woile commented May 8, 2026

sweet!

@woile
Copy link
Copy Markdown
Member

woile commented May 8, 2026

@bearomorphism
Copy link
Copy Markdown
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants