From 9356ad329802ce8d837940f2e1ef7e90da259aba Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 4 Jul 2023 01:12:18 +0300 Subject: [PATCH] Added Image name input (#15) --- README.md | 1 + action.yml | 11 +++++++++-- docs/github-action.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e1a076..80f4b19 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/action.yml b/action.yml index ad43c3d..05301b8 100644 --- a/action.yml +++ b/action.yml @@ -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" @@ -51,9 +55,12 @@ runs: - uses: cloudposse/github-action-yaml-config-query@0.1.3 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 diff --git a/docs/github-action.md b/docs/github-action.md index 563ad68..adba17d 100644 --- a/docs/github-action.md +++ b/docs/github-action.md @@ -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 |