Skip to content

Commit cb8ad98

Browse files
committed
fix(ci): sanitize docker image tags
1 parent b4ea409 commit cb8ad98

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/build-docker.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ jobs:
1616
with:
1717
submodules: "recursive"
1818

19+
- name: Set image tag
20+
run: |
21+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
22+
image_tag="${GITHUB_REF_NAME}"
23+
else
24+
image_tag="${GITHUB_REF_NAME//\//-}"
25+
fi
26+
echo "IMAGE_TAG=$image_tag" >> "$GITHUB_ENV"
27+
1928
- name: Set up QEMU
2029
uses: docker/setup-qemu-action@v3
2130

@@ -40,7 +49,7 @@ jobs:
4049
platforms: linux/amd64,linux/arm64
4150
tags: |
4251
ghcr.io/abetlen/llama-cpp-python:latest
43-
ghcr.io/abetlen/llama-cpp-python:${{ github.ref_name }}
52+
ghcr.io/abetlen/llama-cpp-python:${{ env.IMAGE_TAG }}
4453
build-args: |
4554
BUILDKIT_INLINE_CACHE=1
4655

0 commit comments

Comments
 (0)