jupyterhub/major-minor-tag-calculator

Calculate major and minor semver tags, e.g. for tagging containers. The default is for the action to fetch and parse git tags. Alternatively you can provide the list of existing tags and the new tag, and this action will calculate the output tags without looking at Git. This action returns all considered tags so they can be passed to a second invocation of the action without re-fetching the same Git tags.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jun 8, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: jupyterhub/action-major-minor-tag-calculator@40566ffdf246e5a9e640cf768df890ead4424b22 # v4.0.0

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

namedescriptionrequireddefault
githubTokenThe GitHub token, required so this action can fetch tags using the GitHub API. If this parameter is not set then `defaultTag` (if set) or an empty list will be returned. Omit this if existingTags and newTag are provided.no""
existingTagsList of existing tags as a JSON array, provide this if you aren't processing Git tagsno""
newTagThe new tag, provide this if you aren't processing Git tagsno""
prefixOne or more whitespace or comma delimited prefixes for returned tags. As an example, prefix could be set to `ghcr.io/a/b: quay.io/a/b:` to provide image names with tags for two separate repositories. The string `""` can be used to represent an empty string, and all combinations of prefixes and suffixes are used.no""
suffixOne or more whitespace or comma delimited suffixes for returned tags. As an example, suffix could be set to `"" -debian` to provide a default image variant without suffix next to an image variant referred to with a -debian suffix. The string `""` can be used to represent an empty string, and all combinations of prefixes and suffixes are used.no""
defaultTagIf the tag output would be empty return this tag instead. This can be useful for running a workflow in pull requests where no suitable git references are present. `prefix` or `suffix` are _not_ automatically added.no""
branchRegexIf a branch name does not match this regex return `defaultTag` or empty instead.no^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$
prereleaseHasBuildSet this to "true" if prereleases include a build number (PRE_RELEASE-N), and the returned tags should be PRE_RELEASE-N and PRE_RELEASE. Default is to return pre-releases without processing.no""
namedescription
existingTagsIf this action was configured to fetch Git tags: if this is a tagged commit then this is a list of all fetched Git tags, otherwise null. Otherwise this is the same as inputs.existingTags.
newTagIf this action was configured to fetch Git tags: if this is a tagged commit then this is the current Git tag, otherwise null (inputs.defaultTag is not returned). Otherwise this is the same as inputs.newTag.
tagsA JSON formatted list of calculated tags.