File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ permissions:
1010 contents : write
1111 id-token : write
1212 issues : write
13-
13+
1414jobs :
1515 cleanup :
1616 runs-on : ubuntu-latest
@@ -34,15 +34,25 @@ jobs:
3434 "myStaticWebAppResourceGroup" "contoso" "ignite" "SpringBoot"
3535 "SpeechAppGroup" "MC_"
3636 )
37- # fetch once
3837 rgs=$(az group list --output json)
3938
39+ # don’t exit on errors in this block
40+ set +e
41+
4042 for sub in "${substrings[@]}"; do
4143 echo "Looking for RGs containing '$sub'…"
4244 echo "$rgs" |
4345 jq -r --arg s "$sub" '.[] | select(.name | contains($s)) | .name' |
4446 while read -r rg; do
45- echo "Deleting $rg"
46- az group delete --name "$rg" --yes --no-wait
47+ echo -n "Deleting $rg… "
48+ az group delete \
49+ --name "$rg" \
50+ --yes \
51+ --no-wait \
52+ && echo "OK" \
53+ || echo "⚠️ Skipped (deny-assignment or other error)"
4754 done
4855 done
56+
57+ # restore “exit on error” if you need it later
58+ set -e
You can’t perform that action at this time.
0 commit comments