Skip to content

Commit c157bca

Browse files
authored
DBP-1179-allow-custom-image-name (#29)
* allow custom image tag * added explaining comment
1 parent 0cb188a commit c157bca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/image-publish-trivy.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# image_tag_generation: "ticket_from_branch" The ticket is extracted from the branch name (e.g. OPS-123-testing -> OPS-123)
77
# image_tag_generation: "commit_hash" Short hash of the commit is used as tag
88
# image_tag_generation: "version_git_tag" Git tag with version is used as tag
9+
# image_tag_generation: "specified" The version specified with the image_tag input is used as tag
910
# image_tag_generation: "mmp_git_tag" The tag is derived from git tag with pattern "\d.\d.\d" as mayor.minor.patch version (e.g. infra-tools-1.3.6 -> 1.3.6)
1011
# image_tag_generation: "mm_git_tag" The tag is derived from git tag with pattern "\d.\d" as mayor.minor version (e.g. infra-tools-1.3.6 -> 1.3)
1112
# add_latest_tag: true/false "latest" gets added as additiontal image tag
@@ -37,9 +38,13 @@ on:
3738
type: boolean
3839
default: false
3940
image_tag_generation:
40-
description: "Comma separated list of image tag generation strategies: ticket_from_branch, commit_hash, version_git_tag, mmp_git_tag or mm_git_tag"
41+
description: "Comma separated list of image tag generation strategies: ticket_from_branch, commit_hash, version_git_tag, specified, mmp_git_tag or mm_git_tag"
4142
required: false
4243
type: string
44+
image_tag:
45+
type: string
46+
description: "Custom image tag (required if image_tag_generation: specified)"
47+
required: false
4348
context:
4449
description: "Directory where the image is built, defaults to repository root"
4550
required: false
@@ -123,6 +128,7 @@ jobs:
123128
type=match,pattern=\d.\d,enable=${{ contains(inputs.image_tag_generation, 'mm_git_tag') }}
124129
type=sha,enable=${{ contains(inputs.image_tag_generation, 'commit_hash') }}
125130
type=pep440,pattern={{version}},enable=${{ contains(inputs.image_tag_generation, 'version_git_tag') }}
131+
type=raw,value=${{ inputs.image_tag }},enable=${{ contains(inputs.image_tag_generation, 'specified') }}
126132
flavor: |
127133
latest=${{ inputs.add_latest_tag }}
128134

0 commit comments

Comments
 (0)