3
0
Fork 0
mirror of https://gitea.com/docker/metadata-action.git synced 2024-11-25 21:49:33 +01:00

Merge pull request #160 from stigok/docs-dynamic-latest-tag-example

docs: add example for latest tag with dynamic condition
This commit is contained in:
CrazyMax 2022-01-14 11:06:26 +01:00 committed by GitHub
commit 2cad85de24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -605,6 +605,14 @@ tags: |
* [`type=semver,pattern=...`](#typesemver) * [`type=semver,pattern=...`](#typesemver)
* [`type=match,pattern=...`](#typematch) * [`type=match,pattern=...`](#typematch)
For conditionally tagging with latest for a specific branch name, e.g. if your default branch name
is not `master`, use `type=raw` with a boolean expression:
```yaml
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
```
### Global expressions ### Global expressions
The following [Handlebars template](https://handlebarsjs.com/guide/) expressions for `prefix`, `suffix` and `value` The following [Handlebars template](https://handlebarsjs.com/guide/) expressions for `prefix`, `suffix` and `value`