Skip to content

Commit c92fd52

Browse files
authored
Merge pull request #8 from AidenCohen31/main
[SOFTWARE-5318] Add image_name input variable to container actions
2 parents eb915d4 + 4e1f514 commit c92fd52

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ inputs:
3333
used to pass the Dockerfile as $TIMESTAMP_TAG
3434
required: false
3535
default: ''
36+
image_name:
37+
description: 'Name of the image to build, e.g. "opensciencegrid/software-base"'
38+
required: false
39+
default: ''
3640

3741
runs:
3842
using: "composite"
@@ -42,7 +46,9 @@ runs:
4246
- id: generate-image-name
4347
shell: bash
4448
run: |
45-
if [[ -n "${{ inputs.name }}" ]]; then
49+
if [[ -n ${{ inputs.image_name }} ]]; then
50+
IMAGE_NAME="${{ inputs.image_name }}"
51+
elif [[ -n "${{ inputs.name }}" ]]; then
4652
# A name was specified
4753
IMAGE_NAME=${{ inputs.name }}
4854
elif [[ "${{ inputs.context }}" == "." ]] || \
@@ -56,10 +62,10 @@ runs:
5662
# grab the image name from the full context path instead
5763
IMAGE_NAME=${GITHUB_REPOSITORY%%/*}/$(basename ${{ inputs.context }})
5864
else
59-
echo "${{ inputs.context }} is not a directory"
65+
echo "No image_name provided and ${{ inputs.context }} is not a directory"
6066
exit 1
6167
fi
62-
echo "::set-output name=image::$IMAGE_NAME"
68+
echo "::set-output name=image::${IMAGE_NAME,,}"
6369
6470
- name: Generate tag list
6571
id: generate-tag-list

0 commit comments

Comments
 (0)