bump-my-version-gh-safe-release
Release only what passed the GitHub CI.
A thin layer over bump-my-version, which does all the versioning work: editing the files, committing, tagging. This tool only adds what bump-my-version deliberately leaves out, because it is tied to git hosting:
- Preflight: the working tree is clean, you are on
main, andHEADequalsorigin/main, so you release exactly what is pushed. - Wait for the CI: every GitHub Actions run of that commit must succeed (runs still in progress are waited for, a dropped connection is retried, not taken for a failure). Nothing is tagged otherwise, so no version goes out to be followed by a "CI failed" e-mail and no dangling tag remains.
- Bump or tag:
bump-my-version bump PART --commit --tag, or just tag a version already committed. - Push the commit and the tag atomically: both or neither.
Not affiliated with bump-my-version or its authors.
Install
Add it to a development dependency group in pyproject.toml:
[dependency-groups]
release = ["bump-my-version-gh-safe-release"]
and pip install --group release (pip ≥ 25.1), or run it without installing: uvx --from bump-my-version-gh-safe-release gh-safe-release. Needs git and an authenticated gh.
Use
Configure bump-my-version as usual ([tool.bumpversion] in pyproject.toml or .bumpversion.toml). Then either:
gh-safe-release patch # (or minor, major…) bump, commit, tag, push the commit and the tag
gh-safe-release # the bump is committed and pushed already: check the files hold the version, tag, push the tag
| Option | |
|---|---|
-w, --workflow NAME |
Wait for this workflow (name or file name) only, may be repeated. Default: all runs of the commit pushed to the branch. |
--no-wait-ci |
Skip the CI (ex: a repo without one, or hosted elsewhere). |
--remote, --branch |
Default: origin, main. |
-n, --dry-run |
Check everything, change nothing. |
Without the part, every file configured in bump-my-version must contain its replace text rendered with the current version (other placeholders, like a date, match anything), and the tag must not exist yet. For example with
[tool.bumpversion]
current_version = "1.2.0"
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "## Unreleased"
replace = "## {new_version} ({now:%Y-%m-%d})"
the CHANGELOG.md must contain a ## 1.2.0 (…) heading.
A changelog-driven release
The pattern this tool is built for (see its own pyproject.toml):
- Write the changes under a
## Unreleasedheading inCHANGELOG.md, the bump turns it into## X.Y.Z (YYYY-MM-DD). List theCHANGELOG.mdfirst in[[tool.bumpversion.files]], so that a missing heading fails before anything is written. gh-safe-release patch.- The tag push triggers a CI workflow that runs the tests again, then publishes (PyPI, a GitHub release with the CHANGELOG section as notes). See
.github/workflows/publish.yml.
Metadata
Release files for bump-my-version-gh-safe-release 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bump_my_version_gh_safe_release-0.1.0.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bump_my_version_gh_safe_release-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.2 kB
Release files / bump_my_version_gh_safe_release-0.1.0.tar.gz
| Download URL | bump_my_version_gh_safe_release-0.1.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2592ddc50f0012b54810f66fc5d9c6c493a9e303c961a0ce7e218cc5136f70
|
|
BLAKE2b-256 checksum How to use checksums |
f022ffabefa44c5cd4b193b183d2ec4bb5ccc95ce99b941dd9e35700cc0402dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / bump_my_version_gh_safe_release-0.1.0-py3-none-any.whl
| Download URL | bump_my_version_gh_safe_release-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc856a123951674013827259db1f788b9356f2725672446858f0a957e26f62b3
|
|
BLAKE2b-256 checksum How to use checksums |
31961e7fc23bc61b901ed41d086defaceb822fa77886f631ec40bcb3c8fee31c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency log