Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/damienaicheh/extract-version-from-tag-action


https://github.com/damienaicheh/extract-version-from-tag-action

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Extract version from tag action

This action extract the version from tag and provide different outputs to use in the `job`.

## Usage

To be able to use this action, you must retreive all the history of the repository by using the `fetch-depth` option of the `actions/checkout@v4` as bellow

```yaml
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Mandatory to use the extract version from tag action

- name: Extract version from tag
uses: damienaicheh/[email protected]
```

You will then have access to these outputs:

- The major digit: `$MAJOR`
- The minor digit: `$MINOR`
- The patch digit: `$PATCH`

- If it's a pre-release with like for exemple the `-beta1` the value `beta1` will be extracted inside `$PRE_RELEASE`. If no pre-release is found this output will be empty.

- The number of commits will be available inside: `$NUMBER_OF_COMMITS`.
- The number of commits since tag will be available inside: `$NUMBER_OF_COMMITS_SINCE_TAG`.