Created
November 21, 2020 09:54
-
-
Save kaz/e15434bcd5ad846a8ce76b3453ad57d6 to your computer and use it in GitHub Desktop.
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/sh | |
GITHUB_USER= | |
GITHUB_TOKEN= | |
GITHUB_REPO= | |
URL="https://${GITHUB_USER}:${GITHUB_TOKEN}@api.github.com/repos/${GITHUB_REPO}/deployments" | |
for id in $(curl "${URL}" | jq .[].id); do | |
curl "${URL}/${id}/statuses" -XPOST --data '{"state":"inactive"}' -H "Accept: application/vnd.github.ant-man-preview+json" | |
curl "${URL}/${id}" -XDELETE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment