Coerces Git tag to semver (#3)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2020-10-26 01:39:21 +01:00
committed by GitHub
parent 8ec02f11ef
commit 5bc3bf6dce
13 changed files with 785 additions and 443 deletions

View File

@ -23,6 +23,8 @@ ___
* [inputs](#inputs)
* [outputs](#outputs)
* [Notes](#notes)
* [Latest tag](#latest-tag)
* [Coerces Git tag](#coerces-git-tag)
* [Templates available for schedule tag](#templates-available-for-schedule-tag)
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
* [How can I help?](#how-can-i-help)
@ -114,6 +116,7 @@ Following inputs can be used as `step.with` keys
| `tag-sha` | Bool | Add git short SHA as Docker tag (default `false`) |
| `tag-edge` | Bool | Enable edge branch tagging (default `false`) |
| `tag-edge-branch` | String | Branch that will be tagged as edge (default `repo.default_branch`) |
| `tag-coerce-tag` | String | Coerces Git tag to semver if possible using [Handlebars template](https://handlebarsjs.com/guide/) |
| `tag-schedule` | String | [Handlebars template](https://handlebarsjs.com/guide/) to apply to schedule tag (default `nightly`) |
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
@ -132,6 +135,27 @@ Following outputs are available
## Notes
### Latest tag
`latest` tag is created only on `push tag` event and resolves one of the following conditions:
* Git tag is a valid [semver](https://semver.org/)
* Provided `tag-coerce-tag` is valid
### Coerces Git tag
Provides a very forgiving translation of a non-semver tag to semver. For more information see
[Coercion section](https://www.npmjs.com/package/semver#coercion). `tag-coerce-tag` supports
[Handlebars template](https://handlebarsjs.com/guide/) with the following inputs:
| `tag-coerce-tag` | Git tag | Version |
|-------------------------|----------|---------|
| `{{raw}}` | `v1.2.3` | `1.2.3` |
| `{{major}}.{{minor}}` | `v1.2.3` | `1.2` |
| `{{major}}` | `v1.2.3` | `1` |
| `{{minor}}` | `v1.2.3` | `2` |
| `{{patch}}` | `v1.2.3` | `3` |
### Templates available for schedule tag
`tag-schedule` is specially crafted input to support [Handlebars template](https://handlebarsjs.com/guide/) with