Skip to content

Commit

Permalink
Added Image name input (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored Jul 3, 2023
1 parent 8afa61f commit 9356ad3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ If you skip `from` tag then it would be populated as SHA of the current commit i
| Name | Description | Default | Required |
|------|-------------|---------|----------|
| from | Source tag | N/A | false |
| image\_name | Image name (excluding registry). Defaults to {{$organization/$repository}}. | | false |
| login | Docker login | | false |
| organization | Organization | N/A | true |
| password | Docker password | | false |
Expand Down
11 changes: 9 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
registry:
description: 'Docker registry'
required: true
image_name:
description: "Image name (excluding registry). Defaults to {{$organization/$repository}}."
required: false
default: ''
from:
required: false
description: "Source tag"
Expand Down Expand Up @@ -51,9 +55,12 @@ runs:
- uses: cloudposse/[email protected]
id: context
with:
query: .
query: .${{ inputs.image_name == '' }}
config: |-
image : ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
true:
image : ${{ inputs.registry }}/${{ inputs.organization }}/${{ inputs.repository }}
false:
image : ${{ inputs.registry }}/${{ inputs.image_name }}
- name: Login
uses: docker/login-action@v2
Expand Down
1 change: 1 addition & 0 deletions docs/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Name | Description | Default | Required |
|------|-------------|---------|----------|
| from | Source tag | N/A | false |
| image\_name | Image name (excluding registry). Defaults to {{$organization/$repository}}. | | false |
| login | Docker login | | false |
| organization | Organization | N/A | true |
| password | Docker password | | false |
Expand Down

0 comments on commit 9356ad3

Please sign in to comment.