Old deployments in pages are not always a problem, but can be (for example) if your deployment URLs are public and you make a security fix. This script when ran will delete deployments older than two weeks.
You'll need Deno to run this script and to clone/download this repo.
Step 1: Create a .env file, using the .env.example as an example.
cp .env.example .envCLOUDFLARE_ACCOUNT_ID
You can find your Cloudflare account id in the URL bar, it'll look something like this:
CLOUDFLARE_TOKEN
You need to create an api token that has permissions on your pages project. You can create that on the Cloudflare dashboard.
Select the "Edit Cloudflare Workers template"
CLOUDFLARE_PAGES_PROJECT
This is the name of your pages project which you set when you created itFinally you can run the script
deno task run
