File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 type : string
4343 default : ' centralus'
4444 log_level :
45- description : ' PowerShell log level'
45+ description : ' PowerShell log level (Info, Verbose, Debug) '
4646 required : false
47- type : choice
48- options :
49- - Info
50- - Verbose
51- - Debug
47+ type : string
5248 default : Verbose
5349 skip_teardown :
5450 description : ' Skip teardown (for debugging)'
6965 type : string
7066 default : ' centralus'
7167 log_level :
72- description : ' PowerShell log level'
68+ description : ' PowerShell log level (Info, Verbose, Debug) '
7369 required : false
7470 type : string
7571 default : Verbose
@@ -128,12 +124,18 @@ jobs:
128124 shell : pwsh
129125 run : |
130126 $skipTeardown = '${{ inputs.skip_teardown }}' -eq 'true'
127+ $logLevel = '${{ inputs.log_level }}'
128+ if ([string]::IsNullOrWhiteSpace($logLevel)) { $logLevel = 'Verbose' }
129+ if ($logLevel -notin @('Info', 'Verbose', 'Debug')) {
130+ throw "Invalid log_level '$logLevel'. Allowed values: Info, Verbose, Debug."
131+ }
132+
131133 $params = @{
132134 SourceResourceGroup = '${{ env.SOURCE_RG }}'
133135 TargetResourceGroup = '${{ env.TARGET_RG }}'
134136 SkuName = '${{ inputs.sku }}'
135137 Location = '${{ inputs.location }}'
136- LogLevel = '${{ inputs.log_level }}'
138+ LogLevel = $logLevel
137139 PublisherEmail = '${{ secrets.APIM_PUBLISHER_EMAIL }}'
138140 ExtractOutputDir = './extracted-artifacts'
139141 HardDelete = $true
You can’t perform that action at this time.
0 commit comments