Skip to content

Commit d40c7d4

Browse files
committed
moved image tag max length logic out of conditional block. now applies in all scenarios
1 parent 2c9be6f commit d40c7d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ jobs:
209209
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
210210
SANITIZED_REPO_NAME=$(echo "$_GITHUB_PR_REPO_NAME" | sed "s/[^a-zA-Z0-9]/-/g") # Sanitize repo name to alphanumeric only
211211
IMAGE_TAG=$SANITIZED_REPO_NAME-$IMAGE_TAG # Add repo name to the tag
212-
IMAGE_TAG=${IMAGE_TAG:0:128} # Limit to 128 characters, as that's the max length for Docker image tags
213212
fi
214213
215214
if [[ "$IMAGE_TAG" == "main" ]]; then
216215
IMAGE_TAG=dev
217216
fi
218-
217+
218+
IMAGE_TAG=${IMAGE_TAG:0:128} # Limit image tags to 128 chars
219219
echo "image_tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
220220
echo "### :mega: Docker Image Tag: $IMAGE_TAG" >> "$GITHUB_STEP_SUMMARY"
221221

0 commit comments

Comments
 (0)