Skip to content

Commit a757360

Browse files
Auto Enable Exp if user provides custom values in Workspace, Ai Project input fields
1 parent 2548186 commit a757360

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

.github/workflows/deploy-Parameterized.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ on:
3434
default: false
3535
type: boolean
3636
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
37-
description: 'Use Only if EXP is Enabled - Enter Azure Log Analytics Workspace ID (leave empty for default value)'
37+
description: 'Enter Azure Log Analytics Workspace ID (leave empty for default value)'
3838
required: false
3939
default: ''
4040
type: string
4141
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
42-
description: 'Use Only if EXP is Enabled - Enter Azure AI Project Resource ID (leave empty for default value)'
42+
description: 'Enter Azure AI Project Resource ID (leave empty for default value)'
4343
required: false
4444
default: ''
4545
type: string
@@ -100,27 +100,29 @@ jobs:
100100
echo "ℹ️ Automatic Trigger: Using Non-WAF + Non-EXP configuration"
101101
else
102102
echo "ℹ️ Manual Trigger: Using user-specified configuration"
103+
# Check if EXP was auto-enabled after user input validation
104+
if [[ "${{ env.EXP }}" == "true" && "${{ github.event.inputs.EXP }}" != "true" ]]; then
105+
echo "🔧 Note: EXP was automatically enabled due to provided parameter values"
106+
fi
103107
fi
104108
echo "🚀 ==================================="
105109
106-
- name: Validate EXP Configuration
110+
- name: Validate and Auto-Configure EXP
107111
run: |
108112
echo "🔍 Validating EXP configuration..."
109113
110114
# Check if EXP values were provided but EXP is disabled
111115
if [[ "${{ github.event.inputs.EXP }}" != "true" ]]; then
112116
if [[ -n "${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}" ]] || [[ -n "${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}" ]]; then
113-
echo "❌ ERROR: EXP parameter values were provided but EXP is not enabled!"
117+
echo "🔧 AUTO-ENABLING EXP: EXP parameter values were provided but EXP was not explicitly enabled."
114118
echo ""
115119
echo "You provided values for:"
116120
[[ -n "${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}" ]] && echo " - Azure Log Analytics Workspace ID: '${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}'"
117121
[[ -n "${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}" ]] && echo " - Azure AI Project Resource ID: '${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}'"
118122
echo ""
119-
echo "✅ To fix this:"
120-
echo " 1. Go back and check the 'Enable EXP' checkbox, OR"
121-
echo " 2. Clear the EXP-related fields if you don't want to use EXP"
122-
echo ""
123-
exit 1
123+
echo "✅ Automatically enabling EXP to use these values."
124+
echo "EXP=true" >> $GITHUB_ENV
125+
echo "📌 EXP has been automatically enabled for this deployment."
124126
fi
125127
fi
126128
@@ -585,7 +587,7 @@ jobs:
585587
586588
# Get deployment configuration for notification
587589
WAF_STATUS="${{ github.event.inputs.waf_enabled || true }}"
588-
EXP_STATUS="${{ github.event.inputs.EXP || false }}"
590+
EXP_STATUS="${{ env.EXP || false }}"
589591
CLEANUP_STATUS="${{ github.event.inputs.cleanup_resources || true }}"
590592
591593
# Construct the email body

0 commit comments

Comments
 (0)