Skip to content

Commit

Permalink
add optional prefix for version naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreitung committed Oct 11, 2023
1 parent 863d37b commit baf18ce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ inputs:
default: ""
required: false

image_tag_string_prefix:
description: "optional string that will be added before the semver in the tag like: xxx/myimg:string-0.0.1 instead of xxx/myimg:0.0.1"
default: ""
required: false

context_path:
description: "path to context directory (where the build starts)"
required: true
Expand Down Expand Up @@ -233,8 +238,9 @@ runs:
shell: bash
id: image_tag
run: |
[[ -n "${{ inputs.image_tag_string_suffix }}" ]] && _ver=${{ steps.bump_version.outputs.new_version }}-${{ inputs.image_tag_string_suffix }} || _ver=${{ steps.bump_version.outputs.new_version }}
echo "ver=${_ver}" >> $GITHUB_OUTPUT
[[ -n "${{ inputs.image_tag_string_prefix }}" ]] && _prefix="${{ inputs.image_tag_string_prefix }}-" || _prefix=""
[[ -n "${{ inputs.image_tag_string_suffix }}" ]] && _suffix="-${{ inputs.image_tag_string_suffix }}" || _suffix=""
echo "ver=$_prefix}${_ver}${_suffix}" >> $GITHUB_OUTPUT
- name: Build container meta
id: meta
Expand Down

0 comments on commit baf18ce

Please sign in to comment.