File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ inputs:
3232 image_name :
3333 description : " Image name (excluding registry). Defaults to $organization/$repository"
3434 required : false
35- # TODO: see if this works. If not, add a step to form this value.
36- default : ${{ inputs.organization }}/${{ inputs.repository }}
35+ default : ' '
3736 login :
3837 description : ' Docker login'
3938 required : false
@@ -59,21 +58,31 @@ inputs:
5958outputs :
6059 image :
6160 description : " Docker image name"
62- value : ${{ inputs.registry }}/${{ inputs .image_name }}
61+ value : ${{ inputs.registry }}/${{ steps.image_name.outputs .image_name }}
6362 tag :
6463 description : " Docker image tag"
6564 value : ${{ steps.tag.outputs.output }}
6665
6766runs :
6867 using : " composite"
6968 steps :
69+ - name : Set image name
70+ if : ${{ inputs.image_name == '' }}
71+ id : image_name
72+ shell : bash
73+ run : |
74+ if [ "${{ inputs.image_name }}" = "" ]; then
75+ echo 'image_name=${{ inputs.organization }}/${{ inputs.repository }}' >> "$GITHUB_OUTPUT"
76+ else
77+ echo 'image_name=${{inputs.image_name}}' >> "$GITHUB_OUTPU"
78+ end
7079 - name : Docker meta
7180 id : meta
7281 uses : docker/metadata-action@v4
7382 with :
7483 # list of Docker images to use as base name for tags
7584 images : |
76- ${{ inputs.registry }}/${{ inputs .image_name }}
85+ ${{ inputs.registry }}/${{ steps.image_name.outputs .image_name }}
7786 # generate Docker tags based on the following events/attributes
7887 tags : |
7988 type=sha
You can’t perform that action at this time.
0 commit comments