Skip to content

Commit 9356ad3

Browse files
authored
Added Image name input (#15)
1 parent 8afa61f commit 9356ad3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ If you skip `from` tag then it would be populated as SHA of the current commit i
197197
| Name | Description | Default | Required |
198198
|------|-------------|---------|----------|
199199
| from | Source tag | N/A | false |
200+
| image\_name | Image name (excluding registry). Defaults to {{$organization/$repository}}. | | false |
200201
| login | Docker login | | false |
201202
| organization | Organization | N/A | true |
202203
| password | Docker password | | false |

action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
registry:
1515
description: 'Docker registry'
1616
required: true
17+
image_name:
18+
description: "Image name (excluding registry). Defaults to {{$organization/$repository}}."
19+
required: false
20+
default: ''
1721
from:
1822
required: false
1923
description: "Source tag"
@@ -51,9 +55,12 @@ runs:
5155
- uses: cloudposse/[email protected]
5256
id: context
5357
with:
54-
query: .
58+
query: .${{ inputs.image_name == '' }}
5559
config: |-
56-
image : ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
60+
true:
61+
image : ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
62+
false:
63+
image : ${{ inputs.registry }}/${{ inputs.image_name }}
5764
5865
- name: Login
5966
uses: docker/login-action@v2

docs/github-action.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
| Name | Description | Default | Required |
66
|------|-------------|---------|----------|
77
| from | Source tag | N/A | false |
8+
| image\_name | Image name (excluding registry). Defaults to {{$organization/$repository}}. | | false |
89
| login | Docker login | | false |
910
| organization | Organization | N/A | true |
1011
| password | Docker password | | false |

0 commit comments

Comments
 (0)