feat(semver-compare): add new Github action (#146)

This adds a new Github Action that semantically compares two versions, like 2.1.1 and 2.3.0 giving information about whether or the version is "higher" or "lower" than another version. The action exposes an output called `result` which will match the return type of the PHP [version_compare](https://www.php.net/manual/en/function.version-compare.php) function.

Currently, this action compares `version` against `compare_against` and returns:

- `-1` - if `version` is lower than `compare_against`
- `0` - if `version` is equal to `compare_against`
- `1` - if `version` is greater than `compare_against`

Co-authored-by: Vitaliy Golomoziy <vitaliy.golomoziy@gmail.com>
This commit is contained in:
Damien Retzinger
2023-09-21 08:35:57 -04:00
committed by GitHub
parent bc840e1372
commit 01e4ccbc54
4 changed files with 140 additions and 0 deletions
+1
View File
@@ -31,4 +31,5 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain
| [Setup Magento](./setup-magento/README.md) | A Github Action that sets up Magento before `composer install` for an extension or store. |
| [Get Magento Version](./get-magento-version/README.md) | A Github Action that computes the installed Magento version. |
| [Installation Test](./installation-test/README.md) | A Github Action that tests the installability of a Magento Package |
| [Semver Compare](./semver-compare/README.md) | A Github Action that semantically compares two versions |
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |