@@ -25,17 +25,18 @@ jobs:
25
25
packages : write
26
26
outputs :
27
27
image-node : ${{ steps.image-tag.outputs.image-node-service }}
28
- sha-short : ${{ steps.sha_short .outputs.sha_short }}
28
+ sha-short : ${{ steps.vars .outputs.sha_short }}
29
29
steps :
30
30
- name : Checkout repository
31
31
uses : actions/checkout@v4
32
32
33
- - name : Set SHA_SHORT environment variable
34
- id : sha_short
35
- run : echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
36
-
37
- - name : Check SHA_SHORT environment variable
38
- run : echo ${{ steps.sha_short.outputs.sha_short }}
33
+ - name : Set sha-short and image-name environment variables
34
+ id : vars
35
+ run : |
36
+ image_name=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}" | tr '[:upper:]' '[:lower:]')
37
+ echo "image_name=$image_name" >> $GITHUB_OUTPUT
38
+ sha_short=$(git rev-parse --short HEAD) | tr '[:upper:]' '[:lower:]'
39
+ echo "sha_short=$sha_short" >> $GITHUB_OUTPUT
39
40
40
41
# Login against a Docker registry except on PR
41
42
# https://github.com/docker/login-action
53
54
id : meta
54
55
uses : docker/metadata-action@v5
55
56
with :
56
- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}
57
+ images : ${{ steps.vars.outputs.image_name }}
57
58
tags : |
58
59
type=semver,pattern={{version}}
59
60
type=semver,pattern={{major}}.{{minor}}
75
76
- name : Output image tag
76
77
id : image-tag
77
78
run : |
78
- name=$(echo "image-${{ matrix.services.imageName }}" | tr '[:upper:]' '[:lower:]' )
79
- value=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}:sha-${{ steps.sha_short .outputs.sha_short }}" | tr '[:upper:]' '[:lower:] ')
79
+ name=$(echo "image-${{ steps.vars.outputs.image_name }}")
80
+ value=$(echo "${{ steps.vars.outputs.image_name }}:sha-${{ steps.vars .outputs.sha_short }}"')
80
81
echo "setting output: $name=$value"
81
82
echo "$name=$value" >> $GITHUB_OUTPUT
82
83
0 commit comments