From 5949fa2b947675b2f0e58dae0c8ed904a918089b Mon Sep 17 00:00:00 2001 From: Stig Otnes Kolstad Date: Sun, 9 Jan 2022 13:46:39 +0100 Subject: [PATCH] docs: add example for latest tag with dynamic condition As described in https://github.com/docker/metadata-action/issues/147 Signed-off-by: Stig Otnes Kolstad --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b4cf7f7..69759e8 100644 --- a/README.md +++ b/README.md @@ -605,6 +605,14 @@ tags: | * [`type=semver,pattern=...`](#typesemver) * [`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 The following [Handlebars template](https://handlebarsjs.com/guide/) expressions for `prefix`, `suffix` and `value`