https://github.com/jamaluddinrumi/delete-all-deployments
Delete all inactive Cloudflare Pages deployments
https://github.com/jamaluddinrumi/delete-all-deployments
cloudflare cloudflare-pages
Last synced: 6 months ago
JSON representation
Delete all inactive Cloudflare Pages deployments
- Host: GitHub
- URL: https://github.com/jamaluddinrumi/delete-all-deployments
- Owner: jamaluddinrumi
- License: mit
- Created: 2024-08-20T18:54:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-24T13:39:34.000Z (10 months ago)
- Last Synced: 2025-09-02T13:54:00.524Z (6 months ago)
- Topics: cloudflare, cloudflare-pages
- Language: JavaScript
- Homepage: https://developers.cloudflare.com/pages/platform/known-issues/#delete-a-project-with-a-high-number-of-deployments
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Deletes all deployments given a Pages project name
## How to
### 1. Install dependencies
`bun install`
### 2. Delete all deployments except for the live production deployment (excluding aliased deployments)
```env
# .env
CF_API_TOKEN=xxx
CF_ACCOUNT_ID=xxx
# Delete all deployments except for the live production deployment
# (INCLUDING aliased deployments, eg. my-branch.exampleproj.pages.dev)
# CF_DELETE_ALIASED_DEPLOYMENTS=true
```
### 3. run `start` script
`bun run start `
## How it works
This script uses the Cloudflare API to list all deployments for a given Pages project, then deletes all but the live production deployment.
It uses [exponential-backoff](https://www.npmjs.com/package/exponential-backoff) to retry failed requests.