Version bumper action
evin/version-bumper@v1 scans decorated Git history for the newest
SemVer-compatible tag, maps newer parsed commits to release impacts, computes a
version, edits configured files, and can create one release commit and annotated
tag.
The action is intentionally textual. It is not a package-manager client, does not update dependency locks by itself, and does not publish a release.
Configuration
Unknown fields are rejected at the root, custom-file, and git object levels.
with field | Type | Default | Implemented contract |
|---|---|---|---|
initial_version | SemVer string | 0.1.0 | Version selected directly when no SemVer tag is found. |
files | list | [] | Automatic manifest path strings or custom { path, match, write } objects. |
stable | boolean | false | Remove the current prerelease suffix. Conflicts with prerelease and channel. |
prerelease | string | none | Valid prerelease prefix used when branching from a stable version. Conflicts with stable and channel. |
channel | string | none | Key under releases.prerelease.channels. Conflicts with stable and prerelease. |
require_change | boolean | false | Fail before writing files when qualifying commits do not calculate a new version. |
read_only | boolean | false | Calculate version and package release output without writing files, release locks, or Git state. Requires files: [] and no Git mutations. |
fixed_version | SemVer string | none | Pin the version used for package release output; valid only with read_only: true. |
git | object | defaults below | Controls optional commit, tag, message, and additional staged paths. |
When releases.packages is configured, git.commit and git.tag must both be
true unless read_only is enabled. The action owns .evin/release-lock.json
and additionally publishes a stable compact release JSON output for package
tasks. Read-only mode derives the output from the current Git index and lock
without changing the checkout; fixed_version lets local package tests use the
current workspace version even when later commits would calculate a new one.
This also supports tagged CI package generation.
Git object
git field | Type | Default | Implemented contract |
|---|---|---|---|
commit | boolean | false | Stage version files and include, then create a commit when there is something configured to stage. |
tag | boolean | false | Create the calculated annotated tag after the commit; requires commit: true. |
defer | boolean | false | Stage version and package-lock updates but leave commit and tag creation to a later task; requires commit: true and tag: true. |
message | string | repository policy release message | Optional non-empty template. The only action-local placeholder is ${version}. |
include | list of strings | [] | Additional non-empty paths staged with modified version files. |
git.message, custom match, and custom write reject unsupported ${...}
placeholders during configuration validation. The generic task loader runs
first at execution, but the public local contracts are still:
| Location | Allowed local placeholder |
|---|---|
git.message | ${version} |
custom match | ${previous_version} |
custom write | ${version} |
Use git.defer: true when a later task must add generated release notes before
the final release commit and tag. The action stages its calculated files and
package lock; the later Git release task creates the commit and tag together.
Do not combine read_only: true with files or Git mutation options.
Complete example
tasks:
bump:
stage: Release
steps:
- uses: evin/version-bumper@v1
with:
initial_version: 0.1.0
files:
- Cargo.toml
- package.json
- path: .evin/workspace.flow
match: 'version:\s*"${previous_version}"'
write: 'version: "${version}"'
git:
commit: true
tag: true
message: "chore(release): ${version}"
include: [Cargo.lock]
This commits only files actually changed by the action plus Cargo.lock. It
does not stage every worktree change.
Release boundary and impact discovery
The action asks Git for the complete history in newest-first order. It stops at
the first commit whose decoration exposes a tag that becomes valid SemVer after
leading v characters are removed. Tags below that boundary are not examined.
Commits above the boundary are parsed only with the configured
commits.message_format. Unlike the changelog action, version bumper has no
built-in Conventional Commit parser fallback. Parsed commit types are mapped by
releases.change_types; breaking changes can take the configured major impact.
The greatest impact wins.
| History condition | Calculation entry point |
|---|---|
| No SemVer tag exists | Select initial_version exactly; commit impacts and release mode do not alter it |
SemVer tag exists, but every parsed impact is none or no commit parses | Retain the previous version; package fingerprints may still create a package-only lock commit |
| SemVer tag exists and at least one impact exists | Apply the selected release mode to the previous version |
When there is no prior tag, custom ${previous_version} matching first uses
0.0.0. If that pattern does not match, the action retries with
initial_version, allowing files already at the first release version.
A configured named channel is still looked up and hydrated before this
no-tag branch selects initial_version. Consequently, a missing channel or an
unresolvable channel variable can fail the action even though the hydrated
channel does not alter that initial version.
Version transition rules
Let N be 0 by default or 1 when
releases.prerelease.start_at_one: true.
The releases.versioning.strategy Git rule selects the increment strategy.
The default semver increments the component corresponding to the impact,
including below 1.0.0. With cargo, a base below 1.0.0 maps patch and
minor impacts to a patch increment, and major impact to a minor increment with
the patch reset. From 1.0.0 onward, both strategies use the ordinary mapping.
These rules also apply when starting a prerelease from a stable base.
The former cargo_pre_1_0 action option is no longer accepted. Move the
choice to releases.versioning.strategy in repository policy instead.
| Previous state and mode | Implemented result |
|---|---|
| Stable version, default mode | Bump major/minor/patch according to greatest impact |
Stable version, prerelease: rc | Bump the base according to impact, then append rc.1 |
| Prerelease version, default mode | Increment its final numeric identifier; if none exists, append .1; do not bump the base |
Prerelease version, prerelease: <value> | Same as default prerelease advancement; the supplied prefix is not substituted on this branch |
Prerelease version, stable: true | Remove the prerelease suffix without bumping the base |
Stable version, stable: true | Produces the same base version; the later existing-tag check normally rejects its already-present tag |
Stable version, channel: name | Bump the base, then append the hydrated channel prefix and .N |
| Same-channel prerelease | Increment a final numeric suffix; otherwise reset the suffix to N |
| Different-channel prerelease | Keep the base version and replace the prerelease with the selected prefix plus .N |
The literal prerelease option always starts new stable-to-prerelease branches
at .1; it does not consult start_at_one.
Named channels
Named channels come from repository policy:
releases:
prerelease:
start_at_one: false
channels:
canary: "canary.{n}"
branch: "{git.branch}.{n}"
Supported channel variables are:
| Variable | Resolution |
|---|---|
{n} | Preserved for the version counter |
{workspace.name} | Resolved workspace name; missing name is an error |
{git.branch} | Current branch normalized character-by-character to lowercase alphanumeric or - |
{git.short_sha} | Current abbreviated commit ID |
{date.ymd} | Local date in YYYYMMDD form |
{env.NAME} | Process environment variable; missing or empty is an error |
Unknown variables fail. The version calculator uses the text before {n} as
the channel prefix and trims trailing dots. Place {n} at the end of the
template; text after it is not incorporated into the calculated prerelease.
The hydrated prerelease must also be acceptable to the SemVer parser or it can
collapse to an empty prerelease in the current implementation.
Tracked package release state
Package policies are declared under releases.packages in RepositoryPolicy. EVIN
fingerprints sorted tracked regular files using their canonical Git blob bytes
and executable index mode, so checkout line endings do not alter revisions.
The fixed .evin/release-lock.json records schema 1, the latest semantic
version/tag, package fingerprints, and shared or target-specific revisions.
A changed package resets to revision 1 at a new semantic version and
increments at the same version. Unchanged packages retain their prior package
version. Package-only runs commit only the lock, create no tag, and use the
Evin-Release-Kind: package trailer; semantic discovery ignores those commits.
A no-change run still publishes the lock-derived release JSON.
Migration is explicit: declare package IDs, watched paths, targets, and scope in
RepositoryPolicy; keep package identity and payload configuration in the archive action; enable
bumper commit/tag behavior; give each DEB/APK/Arch task a needs edge, inline
with.package, and release: "${bump.release}"; then run the bumper once and commit
the generated lock. There is no fallback to manifest-owned revisions.
File update forms
Automatic manifest paths
A string entry is accepted only when its basename is one of:
| Basename | Match | Replacement |
|---|---|---|
Cargo.toml | First line matching version = "..." or single quotes | Normalized version = "<next>" |
pyproject.toml | Same TOML expression | Normalized version = "<next>" |
package.json | First member matching "version": "..." or single quotes | Normalized "version": "<next>" |
The regex replacement changes only the first match. It does not understand TOML tables or JSON structure, so the first textual version field may not be the project version.
Custom mappings
files:
- path: VERSION
match: '(?m)^${previous_version}$'
write: '${version}'
| Field | Contract |
|---|---|
path | Non-empty file path read through the task filesystem |
match | Non-empty Rust regular expression after ${previous_version} is replaced with the escaped old version |
write | Non-empty replacement text after ${version} substitution |
The action uses a single regex replacement, not replace_all. Rust regex
replacement expansion still applies to $name and $1 sequences that remain
in the final write value.
When file updates run for a semantic change, an unmatched pattern fails the action, including in automatic mode. A matched replacement that leaves the content unchanged is not considered modified. Missing files and read/write errors fail the action. Writes happen in configuration order, after all configured replacements have been validated. Writes are not rolled back if a later write or Git operation fails.
Tag calculation and preflight
After calculating the version, the action renders the first
tags.name_format with {version}. The default produces v<version>.
The real repository is checked for that tag even when git.tag is false. If
the calculated tag already exists, the action fails before file edits. Tag-name
syntax is checked with Git only when git.tag: true.
Optional Git mutation
When git.commit: true, identity is verified before file edits. After edits:
Enter the Git phase when a semantic release or package lock change exists.
Resolve
git.message, or takereleases.commit_messageand render its{version}field into the local${version}form.Stage modified version files plus every
git.includepath.Require at least one staged change, except for a deferred first release.
Commit with
-Swhen repository policy require signatures.If enabled, create an annotated tag with the commit message as annotation.
For a first release with no staged changes, git.defer: true allows a later
task to prepare and commit release files. Otherwise, no staged changes is an
error. If the commit succeeds and tag creation fails, the commit remains; the
diagnostic reports its ID and intended tag for manual recovery.
Outputs and no-impact behavior
| Path | version | tag |
|---|---|---|
| Normal calculation without a planned Git dry-run commit | Calculated SemVer | Calculated tag-format result, whether or not git.tag is enabled |
| No-impact early return | Previous SemVer | Previous version rendered through the tag format |
Dry run that reaches planned git.commit work | Calculated SemVer | Not published on this return path |
changed is true when qualifying commits calculated a new version and false
otherwise, including when only the release lock refreshed at an unchanged
version. With require_change: false
it lets a later task decide whether a release proposal is warranted instead of
failing the bump. Dry runs publish the same value.
tag is a calculated name; its presence does not prove that a Git tag was
requested or created.
Dry runs
A dry run uses real Git history and real source-file content for calculation, but does not write files or change Git history. Changed files generate update plans.
With
git.commit: false, the action normally publishes both outputs and does not mark the task unverified.With
git.commit: trueand at least one planned file change or a non-emptygit.include, it plans the commit and optional tag, marks the task unverified, publishesversion, and returns before publishingtag.With
git.commit: truebut no changed file and an emptygit.include, it skips the Git plan and publishes both calculated outputs.
See repository policy configuration for commit parsing, impact mapping, channel definitions, release messages, tag formats, and signature policy.
action.evin/version-bumper@v1 Resolve and write the next release version.
Configure version sources and release behavior through with:.
action.evin/[email protected]_only Calculate package release state without changing the checkout.
Use this mode for local artifact builds that need the version-bumper's
release output. It reads the Git index and release lock, but does not write
version files, the lock, or Git state. Leave files empty and Git mutation
options disabled. Set fixed_version to pin local package metadata to the
workspace version instead of calculating a version from Git history.
action.evin/[email protected]_version Pin generated package state to an explicit release version.
Valid only when read_only: true. The value must be a SemVer version; it does
not write version files or Git state.
action.evin/[email protected] Stage calculated release changes for a later commit and tag task.
Requires git.commit: true and git.tag: true. Use it when another task
needs to add generated files, such as a changelog, before the release commit.