Skip to content

Instantly share code, notes, and snippets.

@kaz
Created November 21, 2020 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaz/e15434bcd5ad846a8ce76b3453ad57d6 to your computer and use it in GitHub Desktop.
Save kaz/e15434bcd5ad846a8ce76b3453ad57d6 to your computer and use it in GitHub Desktop.
#!/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