Skip to content

Commit 23372d6

Browse files
committed
Issue opendatahub-io#631: cut the ref name to avoid going over 128 character limit for Docker image tag
1 parent b830f5d commit 23372d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ jobs:
209209
- name: Calculate image name and tag
210210
id: calculated_vars
211211
run: |
212-
SANITIZED_REF_NAME=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/_/g')
212+
# Need for sanitization explained in https://github.com/opendatahub-io/notebooks/issues/631
213+
# For length, Docker image tags have 128-character limit, and we form them as <inputs.target>-<ref_name>_<sha>
214+
# therefore since sha is 40 characters, and our target names are <40 chars, we should cut ref_name at 40
215+
SANITIZED_REF_NAME=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/_/g') | cut -c 1-40
213216
IMAGE_TAG="${SANITIZED_REF_NAME}_${{ github.sha }}"
214217
215218
echo "IMAGE_TAG=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)