Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 01a0f39

Browse files
Handle non-lowercase repo names
1 parent 7b62e9f commit 01a0f39

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
docker_compose:
1414
description: "docker-compose file to build and publish images from"
1515
required: true
16-
repo_token:
16+
repo_token:
1717
description: "Github Repo token"
1818
required: false
1919
default: ''

src/publish.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
VERSION="$1"
22
OVERRIDE="$2"
33
REPO_TOKEN="$3"
4+
GITHUB_REPOSITORY=$(echo "$GITHUB_REPOSITORY" | awk '{print tolower($0)}')
45

56
echo "VERSION=$VERSION"
67
echo "OVERRIDE=$OVERRIDE"
78

8-
docker login ghcr.io -u ${GITHUB_REF} -p ${REPO_TOKEN}
9+
docker login ghcr.io -u "${GITHUB_REF}" -p "${REPO_TOKEN}"
910

10-
VERSION=$VERSION docker-compose -f docker-compose.yml -f $OVERRIDE up --no-start --remove-orphans
11-
IMAGES=$(docker inspect --format='{{.Image}}' $(docker ps -aq))
11+
VERSION=$VERSION docker-compose -f docker-compose.yml -f "$OVERRIDE" up --no-start --remove-orphans
12+
IMAGES=$(docker inspect --format='{{.Image}}' "$(docker ps -aq)")
1213

1314
echo "IMAGES: $IMAGES"
1415
for IMAGE in $IMAGES; do
1516
echo "IMAGE: $IMAGE"
1617

17-
NAME=$(basename ${GITHUB_REPOSITORY}).$(docker inspect --format '{{ index .Config.Labels "name" }}' $IMAGE)
18+
NAME=$(basename "${GITHUB_REPOSITORY}").$(docker inspect --format '{{ index .Config.Labels "name" }}' "$IMAGE")
1819
TAG="ghcr.io/${GITHUB_REPOSITORY}/$NAME:$VERSION"
1920

20-
docker tag $IMAGE $TAG
21-
docker push $TAG
21+
docker tag "$IMAGE" "$TAG"
22+
docker push "$TAG"
2223
done

0 commit comments

Comments
 (0)