Skip to content

Commit 02257de

Browse files
committed
Avoid duplicate image name prefixes (SOFTWARE-5040)
This solved an issue with duplicate 'opensciencegrid/' prefixes when specifying the image name directly. It also makes more sense to move the full image name creation into its own step instead of assuming an 'opensciencegrid/' prefix.
1 parent 72e5967 commit 02257de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ runs:
4242
[[ ${{ inputs.context }} == "./" ]]; then
4343
# Try to guess the image name from our docker repo naming conventions
4444
# E.g., opensciencegrid/docker-frontier-squid
45-
IMAGE_NAME=${GITHUB_REPOSITORY/opensciencegrid\/docker-//}
45+
IMAGE_NAME=${GITHUB_REPOSITORY/\/docker-/\/}
4646
elif [[ -d ${{ inputs.context }} ]]; then
4747
# Assume that the containing dir is the image name
48-
IMAGE_NAME=$(basename ${{ inputs.context }})
48+
# TODO: to support more orgs in the opensciencegrid/images repo,
49+
# grab the image name from the full context path instead
50+
IMAGE_NAME=${GITHUB_REPOSITORY%%/*}/$(basename ${{ inputs.context }})
4951
else
5052
echo "${{ inputs.context }} is not a directory"
5153
exit 1
@@ -60,7 +62,7 @@ runs:
6062
REGISTRY: ${{ inputs.registry_url}}
6163
shell: bash
6264
run: |
63-
docker_repo="$REGISTRY/opensciencegrid/${{ steps.generate-image-name.outputs.image }}"
65+
docker_repo="$REGISTRY/${{ steps.generate-image-name.outputs.image }}"
6466
tag_list=()
6567
TIMESTAMP=$(date +%Y%m%d-%H%M)
6668
for image_tag in "$OSG_SERIES-$REPO" "$OSG_SERIES-$REPO-$TIMESTAMP"; do

0 commit comments

Comments
 (0)