mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-23 19:27:58 +02:00
Handle global expressions (#71)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
20
README.md
20
README.md
@ -38,6 +38,7 @@ ___
|
||||
* [`type=sha`](#typesha)
|
||||
* [Notes](#notes)
|
||||
* [Latest tag](#latest-tag)
|
||||
* [Global expressions](#global-expressions)
|
||||
* [Overwrite labels](#overwrite-labels)
|
||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
||||
* [Contributing](#contributing)
|
||||
@ -554,6 +555,25 @@ tags: |
|
||||
* [`type=semver,pattern=...`](#typesemver)
|
||||
* [`type=match,pattern=...`](#typematch)
|
||||
|
||||
### Global expressions
|
||||
|
||||
The following [Handlebars template](https://handlebarsjs.com/guide/) expressions for `prefix`, `suffix` and `value`
|
||||
attributes are available:
|
||||
|
||||
| Expression | Output |
|
||||
|--------------------------|----------------------|
|
||||
| `{{branch}}` | `master` |
|
||||
| `{{tag}}` | `v1.2.3` |
|
||||
| `{{sha}}` | `90dd603` |
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
# dynamically set the branch name as a prefix
|
||||
type=sha,prefix={{branch}}-
|
||||
# dynamically set the branch name and sha as a custom tag
|
||||
type=raw,value=mytag-{{branch}}-{{sha}}
|
||||
```
|
||||
|
||||
### Overwrite labels
|
||||
|
||||
If some of the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
|
||||
|
Reference in New Issue
Block a user