You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo "❌ ERROR: RESOURCE_GROUP_NAME '$INPUT_RESOURCE_GROUP_NAME' is invalid. Must contain only alphanumerics, periods, underscores, hyphens, and parentheses. Cannot end with period."
124
+
VALIDATION_FAILED=true
125
+
elif [[ ${#INPUT_RESOURCE_GROUP_NAME} -gt 90 ]]; then
echo "✅ RESOURCE_GROUP_NAME: '$INPUT_RESOURCE_GROUP_NAME' is valid"
130
+
fi
131
+
132
+
# Validate AZURE_LOCATION (required, Azure region format)
133
+
if [[ -z "$INPUT_AZURE_LOCATION" ]]; then
134
+
echo "❌ ERROR: AZURE_LOCATION is required but was not provided"
135
+
VALIDATION_FAILED=true
136
+
elif [[ ! "$INPUT_AZURE_LOCATION" =~ ^[a-z0-9]+$ ]]; then
137
+
echo "❌ ERROR: AZURE_LOCATION '$INPUT_AZURE_LOCATION' is invalid. Must contain only lowercase letters and numbers (e.g., 'australiaeast', 'westus2')"
138
+
VALIDATION_FAILED=true
139
+
else
140
+
echo "✅ AZURE_LOCATION: '$INPUT_AZURE_LOCATION' is valid"
141
+
fi
142
+
143
+
# Validate AZURE_ENV_OPENAI_LOCATION (required, Azure region format)
144
+
if [[ -z "$INPUT_AZURE_ENV_OPENAI_LOCATION" ]]; then
145
+
echo "❌ ERROR: AZURE_ENV_OPENAI_LOCATION is required but was not provided"
146
+
VALIDATION_FAILED=true
147
+
elif [[ ! "$INPUT_AZURE_ENV_OPENAI_LOCATION" =~ ^[a-z0-9]+$ ]]; then
148
+
echo "❌ ERROR: AZURE_ENV_OPENAI_LOCATION '$INPUT_AZURE_ENV_OPENAI_LOCATION' is invalid. Must contain only lowercase letters and numbers (e.g., 'australiaeast', 'westus2')"
149
+
VALIDATION_FAILED=true
150
+
else
151
+
echo "✅ AZURE_ENV_OPENAI_LOCATION: '$INPUT_AZURE_ENV_OPENAI_LOCATION' is valid"
152
+
fi
153
+
154
+
# Validate ENV_NAME (required)
155
+
if [[ -z "$INPUT_ENV_NAME" ]]; then
156
+
echo "❌ ERROR: ENV_NAME is required but was not provided"
157
+
VALIDATION_FAILED=true
158
+
else
159
+
echo "✅ ENV_NAME: '$INPUT_ENV_NAME' is valid"
160
+
fi
161
+
162
+
# Validate IMAGE_TAG (required, Docker tag pattern)
163
+
if [[ -z "$INPUT_IMAGE_TAG" ]]; then
164
+
echo "❌ ERROR: IMAGE_TAG is required but was not provided"
165
+
VALIDATION_FAILED=true
166
+
elif [[ ! "$INPUT_IMAGE_TAG" =~ ^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$ ]]; then
167
+
echo "❌ ERROR: IMAGE_TAG '$INPUT_IMAGE_TAG' is invalid. Must:"
168
+
echo " - Start with alphanumeric or underscore"
169
+
echo " - Contain only alphanumerics, underscores, periods, hyphens"
170
+
echo " - Be max 128 characters"
171
+
VALIDATION_FAILED=true
172
+
else
173
+
echo "✅ IMAGE_TAG: '$INPUT_IMAGE_TAG' is valid"
174
+
fi
175
+
176
+
# Fail workflow if any validation failed
177
+
if [[ "$VALIDATION_FAILED" == "true" ]]; then
178
+
echo ""
179
+
echo "❌ Parameter validation failed. Please correct the errors above and try again."
180
+
exit 1
181
+
fi
182
+
183
+
echo ""
184
+
echo "✅ All input parameters validated successfully!"
0 commit comments