File tree 1 file changed +27
-7
lines changed
1 file changed +27
-7
lines changed Original file line number Diff line number Diff line change 19
19
required : false
20
20
type : string
21
21
description : " CDN Endpoint."
22
+ resourceType :
23
+ required : false
24
+ type : string
25
+ description : " Resource Type. Can be either 'frontdoor' or 'cdn'."
26
+ default : ' cdn'
22
27
secrets :
23
28
azureCredentials :
24
29
required : true
@@ -41,19 +46,34 @@ jobs:
41
46
Write-Error "CDN Resource Group is required. Please provide the CDN Resource Group name when calling the workflow."
42
47
exit 1
43
48
}
49
+ else {
50
+ $ResourceGroup="${{ inputs.cdnResourceGroup }}"
51
+ }
44
52
45
53
if (-not ${{ inputs.cdnProfile }}) {
46
54
Write-Error "CDN Profile is required. Please provide the CDN Profile name when calling the workflow."
47
55
exit 1
48
56
}
57
+ else {
58
+ $ProfileName="${{ inputs.cdnProfile }}"
59
+ }
49
60
50
61
if (-not ${{ inputs.cdnEndpoint }}) {
51
- Write-Error "CDN Endpoint is required. Please provide the CDN Endpoint name when calling the workflow."
52
- exit 1
62
+ if ("${{ github.event.repository.name }}" -match "*_game") {
63
+ $EndpointName = (az afd endpoint list --profile-name "$ProfileName" --resource-group "$ResourceGroup" --query "[?tags.\"repository-name\" == '${{ github.event.repository.name }}'].name" -o tsv)
64
+ }
65
+ else {
66
+ Write-Error "CDN Endpoint is required. Please provide the CDN Endpoint name when calling the workflow."
67
+ exit 1
68
+ }
69
+ }
70
+ else {
71
+ $EndpointName="${{ inputs.cdnEndpoint }}"
53
72
}
54
73
55
- $ResourceGroup = "${{ inputs.cdnResourceGroup }}"
56
- $ProfileName = "${{ inputs.cdnProfile }}"
57
- $EndpointName = "${{ inputs.cdnEndpoint }}"
58
-
59
- Clear-AzCdnEndpointContent -EndpointName $EndpointName -ProfileName $ProfileName -ResourceGroupName $ResourceGroup -ContentPath '/*'
74
+ if (${{ inputs.resourceType }} -eq 'frontdoor') {
75
+ Clear-AzFrontDoorEndpointContent -EndpointName $EndpointName -ProfileName $ProfileName -ResourceGroupName $ResourceGroup -ContentPaths '/*'
76
+ }
77
+ else {
78
+ Clear-AzCdnEndpointContent -EndpointName $EndpointName -ProfileName $ProfileName -ResourceGroupName $ResourceGroup -ContentPath '/*'
79
+ }
You can’t perform that action at this time.
0 commit comments