Skip to content

Commit

Permalink
docs: add example for latest tag with dynamic condition
Browse files Browse the repository at this point in the history
As described in
https://github.com/docker/metadata-action/issues/147

Signed-off-by: Stig Otnes Kolstad <stig@stigok.com>
  • Loading branch information
Stig Otnes Kolstad authored and Stig Otnes Kolstad committed Jan 14, 2022
1 parent e562237 commit 5949fa2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 5949fa2

Please sign in to comment.