File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ inputs:
2929 description : " Sets the target stage to build"
3030 required : false
3131 default : ' '
32+ image_name :
33+ description : " Image name (excluding registry). Defaults to {{$organization/$repository}}."
34+ required : false
35+ default : ' '
3236 login :
3337 description : ' Docker login'
3438 required : false
@@ -54,21 +58,30 @@ inputs:
5458outputs :
5559 image :
5660 description : " Docker image name"
57- value : ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
61+ value : ${{ inputs.registry }}/${{ steps.image_name.outputs.image_name }}
5862 tag :
5963 description : " Docker image tag"
6064 value : ${{ steps.tag.outputs.output }}
6165
6266runs :
6367 using : " composite"
6468 steps :
69+ - name : Set image name
70+ id : image_name
71+ shell : bash
72+ run : |
73+ if [ "${{ inputs.image_name }}" = "" ]; then
74+ echo 'image_name=${{ inputs.organization }}/${{ inputs.repository }}' >> "$GITHUB_OUTPUT"
75+ else
76+ echo 'image_name=${{inputs.image_name}}' >> "$GITHUB_OUTPUT"
77+ fi
6578 - name : Docker meta
6679 id : meta
6780 uses : docker/metadata-action@v4
6881 with :
6982 # list of Docker images to use as base name for tags
7083 images : |
71- ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
84+ ${{ inputs.registry }}/${{ steps.image_name.outputs.image_name }}
7285 # generate Docker tags based on the following events/attributes
7386 tags : |
7487 type=sha
You can’t perform that action at this time.
0 commit comments