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 GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jun 8, 2026
- License
- MIT
Pinned Snippet
uses: jupyterhub/action-major-minor-tag-calculator@40566ffdf246e5a9e640cf768df890ead4424b22 # v4.0.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| githubToken | The 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 | "" |
| existingTags | List of existing tags as a JSON array, provide this if you aren't processing Git tags | no | "" |
| newTag | The new tag, provide this if you aren't processing Git tags | no | "" |
| prefix | One 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 | "" |
| suffix | One 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 | "" |
| defaultTag | If 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 | "" |
| branchRegex | If a branch name does not match this regex return `defaultTag` or empty instead. | no | ^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$ |
| prereleaseHasBuild | Set 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 | "" |
Outputs
| name | description |
|---|---|
| existingTags | If 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. |
| newTag | If 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. |
| tags | A JSON formatted list of calculated tags. |