-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
42 lines (39 loc) · 1.23 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: 'Docker Image Tag'
description: 'Outputs a nice Docker image tag for GitHub container registry'
inputs:
product-name:
description: 'Your product name'
required: true
service-suffix:
description: 'Specifies suffix with service name'
required: false
input-version:
description: 'Passes given version to tag instead of Git tag'
required: false
outputs:
image-tag:
description: 'Ready-to-use image tag'
value: ${{ steps.generate-tag.outputs.image-tag }}
runs:
using: 'composite'
steps:
- name: Generate image tag for ghcr.io
id: generate-tag
shell: bash
run: |
git_tag_last="$(git describe --tags --abbrev=0)"
image_tag="$( \
${{ github.action_path }}/generate-tag.sh \
"${{ inputs.product-name }}" \
"${{ inputs.service-suffix }}" \
"${{ inputs.input-version }}" \
"${{ github.repository }}" \
"${{ github.ref_type }}" \
"${{ github.ref_name }}" \
"${{ github.sha }}" \
"${git_tag_last}" \
)"
echo "image-tag=${image_tag}" >> $GITHUB_OUTPUT
- name: Update GITHUB_PATH
shell: bash
run: echo "${{ github.action_path }}" >> $GITHUB_PATH