Deletes Cloudflare deployments older than 7 days.
https://developers.cloudflare.com/api/operations/pages-deployment-delete-deployment
Installation
npm install -g deploymentdelete
CLI Usage
DeploymentDelete -e example@account.com -i accountId -k accountKey
Note
This will not delete your last running deployment.
Options
-V, --version output the version number
-e, --Email <Email> Cloudflare Account E-mail.
-i, --ID <ID> Cloudflare Account ID.
-k, --Key <Key> Cloudflare API key.
-h, --help display help for command
Worker
You can also publish it as a worker:
wrangler publish

Script
Source/Index.ts
import Delete from "deploymentdelete";
await Delete(Email, ID, Key);
.env
Email = "example@account.com";
ID = "accountId";
Key = "accountKey";
Changelog
See CHANGELOG.md for a history of changes to this utility.