Skip to content

Commit 400bd87

Browse files
authored
Major version zero doc (#74)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
1 parent e4fc7e9 commit 400bd87

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ___
3939
* [Notes](#notes)
4040
* [Latest tag](#latest-tag)
4141
* [Global expressions](#global-expressions)
42+
* [Major version zero](#major-version-zero)
4243
* [Overwrite labels](#overwrite-labels)
4344
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
4445
* [Contributing](#contributing)
@@ -574,6 +575,25 @@ tags: |
574575
type=raw,value=mytag-{{branch}}-{{sha}}
575576
```
576577

578+
### Major version zero
579+
580+
Major version zero (`0.y.z`) is for initial development and **may** change at any time. This means the public API
581+
[**should not** be considered stable](https://semver.org/#spec-item-4).
582+
583+
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver) with `{{major}}`
584+
pattern. You can manage this behavior like this:
585+
586+
```yaml
587+
# refs/tags/v0.1.2
588+
tags: |
589+
# output 0.1.2
590+
type=semver,pattern={{version}}
591+
# output 0.1
592+
type=semver,pattern={{major}}.{{minor}}
593+
# disabled if major zero
594+
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
595+
```
596+
577597
### Overwrite labels
578598

579599
If some of the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)

0 commit comments

Comments
 (0)