paulhatch/Git Semantic Version

Determines version of a repo based on git history

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Mar 17, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: paulhatch/semantic-version@9f72830310d5ed81233b641ee59253644cd8a8fc # v6.0.2

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
branchSet to specify a specific branch, default is the current HEADyesHEAD
tag_prefixThe prefix to use to identify tagsnov
use_branches(Deprecated) Use branches instead of tagsnofalse
version_from_branchIf true, the branch will be used to select the maximum versionnofalse
major_patternA string which, if present in a git commit, indicates that a change represents a major (breaking) change. Wrap with '/' to match using a regular expression.yes/!:|BREAKING CHANGE:/
major_regexp_flagsA string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgsno""
minor_patternA string which, if present in a git commit, indicates that a change represents a minor (feature) change. Wrap with '/' to match using a regular expression.yes/feat(\(.+\))?:/
minor_regexp_flagsA string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgsno""
ignore_commits_patternA pattern to match commits that should be ignored when calculating the version. Commits matching this pattern will not trigger any version bump. Wrap with '/' to use a regular expression.no""
version_formatPattern to use when formatting output versionyes${major}.${minor}.${patch}
change_pathPath to check for changes. If any changes are detected in the path the 'changed' output will true. Enter multiple paths separated by spaces.no
namespaceUse to create a named sub-version. This value will be appended to tags created for this version.no
bump_each_commitIf true, every commit will be treated as a bump to the version.yesfalse
search_commit_bodyIf true, the body of commits will also be searched for major/minor patterns to determine the version type.yesfalse
user_format_typeThe output method used to generate list of users, 'csv' or 'json'. Default is 'csv'.yescsv
enable_prerelease_modePrevents pre-v1.0.0 version from automatically incrementing the major version. If enabled, when the major version is 0, major releases will be treated as minor and minor as patch. Note that the version_type output is unchanged.yesfalse
bump_each_commit_patch_patternIf bump_each_commit is also set to true, setting this value will cause the version to increment only if the pattern specified is matched.yes""
debugIf enabled, diagnostic information will be added to the action outputyesfalse
namedescription
majorCurrent major number
minorCurrent minor number
patchCurrent patch number
incrementAn additional value indicating the number of commits for the current version
version_typeIndicates the type of change this version represents vs the previous, e.g. 'major', 'minor', 'patch', or 'none'
versionThe version result, in the format {major}.{minor}.{patch}
version_tagThe version tag
changedIndicates whether there was a change since the last version if change_path was specified. If no change_path was specified this value will always be true since the entire repo is considered.
is_taggedIndicates that the commit had a tag that matched the 'versionTag' format
authorsList of users contributing commits to this version
previous_commitHash of the previous commit
previous_versionIndicates the previous version
current_commitThe current commit hash
debug_outputDiagnostic information, if debug is enabled