Created
August 16, 2024 12:20
-
-
Save L480/bda5cc2bd8267c7c4cced76b2e581497 to your computer and use it in GitHub Desktop.
GitHub Deployment Cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ENV=$1 | |
for ID in $(gh api -X GET /repos/L480/repo/deployments?environment=${ENV// /%20} | jq -r ".[] | .id") | |
do | |
echo "Deleting deployment $ID" | |
gh api -X DELETE /repos/L480/repo/deployments/$ID | jq '.' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment