2 Inputs and outputs
Stefano Pigozzi edited this page 2025-12-11 02:13:46 +01:00

Inputs

This action takes a single input, string, described below.

string

The string to split into semantic version numbers.

Examples

Some acceptable inputs might be:

  1. v1.2.3
  2. version 123.456.789-beta.1
  3. garas 6.7.79+auto

Outputs

The value of the string input is matched against the following regular expression:

(((([0-9]+)[.]([0-9]+))[.]([0-9]+))(-([a-zA-Z0-9.]+))?)(\+([a-zA-Z0-9.]+))?

Captured groups become this Action's outputs, described below; anything that is not matched is ignored.

Tip

If you are making use of this Action, do not expect to use all outputs; most likely, you will need only one or a few of them.

full

The semantic version detected in string with all its components, however excluding any external data.

Corresponding to match 0 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 1.2.3
  2. `123.456.789-beta.1
  3. 6.7.79+auto

precedence

The semantic version detected in string, but with metadata excluded.

Corresponding to match 1 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 1.2.3
  2. 123.456.789-beta.1
  3. 6.7.79

core

The semantic version detected in string, but with metadata and pre-release version excluded.

Corresponding to match 2 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 1.2.3
  2. 123.456.789
  3. 6.7.79

pair

The semantic version detected in string, but including only major and minor version, excluding anything from patch level and below.

Corresponding to match 3 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 1.2
  2. 123.456
  3. 6.7

major

The major version detected in string.

Corresponding to match 4 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 1
  2. 123
  3. 6

minor

Only the minor version detected in string.

Corresponding to match 5 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 2
  2. 456
  3. 7

patch

Only the patch version detected in string.

Corresponding to match 6 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. 3
  2. 789
  3. 79

prerelease

Only the prerelease version detected in string.

Corresponding to match 8 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. empty string
  2. beta.1
  3. empty string

metadata

Only the metadata detected in string.

Corresponding to match 10 of the regular expression.

Examples

Given the input examples, corresponding outputs will be:

  1. empty string
  2. empty string
  3. auto