Merge branch 'master' into release-v0.25.0

This commit is contained in:
Abhishek K 2024-09-02 17:11:30 +05:30 committed by GitHub
commit 0dcf68f154
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,11 +37,25 @@ jobs:
- name: delete droplets
if: success() || failure()
run: |
sleep 15m
curl -X DELETE \
sleep 5m
response=$(curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/droplets?tag_name=$TAG"
-w "\n%{http_code}" \
"https://api.digitalocean.com/v2/droplets?tag_name=$TAG")
status_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
echo "Response body: $body"
echo "Status code: $status_code"
if [ "$status_code" -eq 204 ]; then
echo "Droplets deleted successfully"
else
echo "Failed to delete droplets. Status code: $status_code"
exit 1
fi
env:
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
TAG: ${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}