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 "List of resources to check: ${resources_to_check[@]}"
88
+
resource_list=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --output yaml)
89
+
max_retries=3
90
+
retry_intervals=(60 120 140)
91
+
retries=0
92
+
while true; do
93
+
resource_found=false
94
+
for resource in "${resources_to_check[@]}"; do
95
+
echo "Checking resource: $resource"
96
+
if echo "$resource_list" | grep -q "name: $resource"; then
97
+
echo "Resource '$resource' exists in the resource group."
98
+
resource_found=true
99
+
else
100
+
echo "Resource '$resource' does not exist in the resource group."
101
+
fi
102
+
done
103
+
if [ "$resource_found" = true ]; then
104
+
retries=$((retries + 1))
105
+
if [ "$retries" -ge "$max_retries" ]; then
106
+
echo "Maximum retry attempts reached. Exiting."
107
+
break
108
+
else
109
+
echo "Waiting for ${retry_intervals[$retries-1]} seconds before retrying..."
110
+
sleep ${retry_intervals[$retries-1]}
111
+
fi
112
+
else
113
+
echo "No resources found. Exiting."
114
+
break
115
+
fi
116
+
done
117
+
118
+
- name: Purge OpenAI Resource
119
+
if: success()
120
+
run: |
121
+
echo "Purging the OpenAI Resource..."
122
+
if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/westus/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/deletedAccounts/${{ env.OPENAI_RESOURCE_NAME }} --verbose; then
123
+
echo "Failed to purge OpenAI resource: ${{ env.OPENAI_RESOURCE_NAME }}"
124
+
else
125
+
echo "Purged the OpenAI resource: ${{ env.OPENAI_RESOURCE_NAME }}"
"body": "<p>Dear Team,</p><p>We would like to inform you that the Multi-Agent-Custom-Automation-Engine-Solution-Accelerator Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
138
+
}
139
+
EOF
140
+
)
141
+
142
+
# Send the notification
143
+
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
144
+
-H "Content-Type: application/json" \
145
+
-d "$EMAIL_BODY" || echo "Failed to send notification"
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
0 commit comments