Loading ci-templates/default.yml +3 −4 Original line number Diff line number Diff line Loading @@ -17,13 +17,12 @@ stages: # Replace '/' with '-' and check for any invalid characters APP_VERSION=$(echo "$CI_COMMIT_REF_NAME" | sed 's|/|-|g') # Check for invalid characters (only allow lowercase letters, digits, '_', '.', '-') # Check for invalid characters (only allow lowercase and uppercase letters, digits, '_', '.', '-') if echo "$APP_VERSION" | grep -q '[^a-zA-Z0-9._-]'; then echo "Error: Branch name contains invalid characters for Docker tags. Only a-z, 0-9, '_', '.', and '-' are allowed." echo "Error: Branch name contains invalid characters for Docker tags. Only a-z, A-Z, 0-9, '_', '.', and '-' are allowed." exit 1 fi # Convert to lowercase export APP_VERSION=$(echo "$APP_VERSION" | tr 'A-Z' 'a-z') export APP_VERSION fi - echo "APP_VERSION set to $APP_VERSION" Loading
ci-templates/default.yml +3 −4 Original line number Diff line number Diff line Loading @@ -17,13 +17,12 @@ stages: # Replace '/' with '-' and check for any invalid characters APP_VERSION=$(echo "$CI_COMMIT_REF_NAME" | sed 's|/|-|g') # Check for invalid characters (only allow lowercase letters, digits, '_', '.', '-') # Check for invalid characters (only allow lowercase and uppercase letters, digits, '_', '.', '-') if echo "$APP_VERSION" | grep -q '[^a-zA-Z0-9._-]'; then echo "Error: Branch name contains invalid characters for Docker tags. Only a-z, 0-9, '_', '.', and '-' are allowed." echo "Error: Branch name contains invalid characters for Docker tags. Only a-z, A-Z, 0-9, '_', '.', and '-' are allowed." exit 1 fi # Convert to lowercase export APP_VERSION=$(echo "$APP_VERSION" | tr 'A-Z' 'a-z') export APP_VERSION fi - echo "APP_VERSION set to $APP_VERSION"