Skip to content

Instantly share code, notes, and snippets.

@henteko
Created February 8, 2023 06:06
Show Gist options
  • Save henteko/84794f91da38b2417044509a1450a76a to your computer and use it in GitHub Desktop.
Save henteko/84794f91da38b2417044509a1450a76a to your computer and use it in GitHub Desktop.
curl \
--url https://deploygate.com/api/users/${OWNER_NAME}/platforms/${PLATFORM_TYPE}/apps/${APP_ID}/distributions \
-H "Authorization: Bearer ${API_TOKEN}" \
-X GET | \
jq '.results.distributions[] | select(.updated_at < (now - 31*24*60*60)).access_key' | \
xargs -I {} \
curl --url https://deploygate.com/api/distributions/{} \
-H "Authorization: Bearer ${API_TOKEN}" \
-X DELETE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment