{"id":28444981,"url":"https://github.com/th3s4mur41/cleanup-cloudflare-deployments","last_synced_at":"2026-04-13T20:04:06.715Z","repository":{"id":296075700,"uuid":"992106946","full_name":"Th3S4mur41/cleanup-cloudflare-deployments","owner":"Th3S4mur41","description":"GitHub Action to remove old deployments of Cloudflare pages","archived":false,"fork":false,"pushed_at":"2026-04-02T22:05:53.000Z","size":1768,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T19:30:29.443Z","etag":null,"topics":["actions","cleanup","cloudflare","dele","deployments","github","github-actions","pages","purge","remove"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Th3S4mur41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-28T16:19:08.000Z","updated_at":"2026-04-02T12:31:01.000Z","dependencies_parsed_at":"2025-05-28T21:47:02.346Z","dependency_job_id":"fad6938f-16b5-4620-a758-15d225b1e7b0","html_url":"https://github.com/Th3S4mur41/cleanup-cloudflare-deployments","commit_stats":null,"previous_names":["th3s4mur41/cleanup-cloudflare-deployments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Th3S4mur41/cleanup-cloudflare-deployments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Th3S4mur41%2Fcleanup-cloudflare-deployments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Th3S4mur41%2Fcleanup-cloudflare-deployments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Th3S4mur41%2Fcleanup-cloudflare-deployments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Th3S4mur41%2Fcleanup-cloudflare-deployments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Th3S4mur41","download_url":"https://codeload.github.com/Th3S4mur41/cleanup-cloudflare-deployments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Th3S4mur41%2Fcleanup-cloudflare-deployments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31768697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","cleanup","cloudflare","dele","deployments","github","github-actions","pages","purge","remove"],"created_at":"2025-06-06T09:44:00.520Z","updated_at":"2026-04-13T20:04:06.710Z","avatar_url":"https://github.com/Th3S4mur41.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Pages Deployment Cleanup Action\n\nThis GitHub Action automatically cleans up old or orphaned deployments from your Cloudflare Pages project. It helps you manage your Cloudflare Pages deployments by deleting preview deployments for deleted branches and keeping only a specified number of the most recent deployments for each branch and production.\n\n## Features\n- Deletes preview deployments for branches that no longer exist in your repository.\n- Keeps only the N most recent preview deployments per branch (configurable).\n- Keeps only the N most recent production deployments (configurable).\n- Supports dry-run mode to preview what would be deleted.\n- Provides a summary of actions in the GitHub Actions workflow summary.\n\n## Required Permissions\n\nThe action requires the following permissions for the `GITHUB_TOKEN`:\n\n```yaml\npermissions:\n  contents: read  # To list branches in the repository\n```\n\nIf you use a custom token, ensure it has at least `repo` scope for private repositories.\n\n## Inputs\n\n| Name                  | Description                                                      | Required | Default   |\n|-----------------------|------------------------------------------------------------------|----------|-----------|\n| cloudflare-api-token  | Cloudflare API token with access to Pages deployments             | true     |           |\n| cloudflare-account-id | Cloudflare Account ID                                             | true     |           |\n| cloudflare-project-name | Cloudflare Pages project name                                   | true     |           |\n| github-token          | GitHub token (defaults to `secrets.GITHUB_TOKEN`)                | false    |           |\n| cleanup-types         | Which deployments to clean: `preview`, `production`, or `all`    | false    | preview   |\n| preview-keep          | Number of preview deployments to keep per branch                 | false    | 1         |\n| production-keep       | Number of production deployments to keep                         | false    | 1         |\n| dry-run               | If `true`, no deployments are deleted (for testing)              | false    | false     |\n\n## Usage\n\n### Minimal Example\n\n```yaml\nname: Cleanup Cloudflare Pages Deployments\non:\n  workflow_dispatch:\n  schedule:\n    - cron: '0 3 * * *'  # Every day at 3am UTC\n\npermissions:\n  contents: read\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Cleanup Cloudflare Pages Deployments\n        uses: ./  # or use the repository path if published\n        with:\n          cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n          cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}\n          cloudflare-project-name: ${{ secrets.CLOUDFLARE_PAGE_NAME }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Advanced Example (All Options)\n\n```yaml\nname: Cleanup Cloudflare Pages Deployments\non:\n  push:\n    branches: [main]\n\npermissions:\n  contents: read\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Cleanup Cloudflare Pages Deployments\n        uses: ./\n        with:\n          cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}\n          cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}\n          cloudflare-project-name: ${{ secrets.CLOUDFLARE_PAGE_NAME }}\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          cleanup-types: all\n          preview-keep: 2\n          production-keep: 3\n          dry-run: 'true'\n```\n\n## Cloudflare API Token Requirements\n\nThe Cloudflare API token must have permissions for **Pages:Edit** on the relevant account.\n\n## Output\n\n- The action prints a summary table of kept deployments and a count of deleted deployments in the workflow summary.\n- In dry-run mode, no deployments are deleted; the action only prints what would be deleted.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth3s4mur41%2Fcleanup-cloudflare-deployments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fth3s4mur41%2Fcleanup-cloudflare-deployments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth3s4mur41%2Fcleanup-cloudflare-deployments/lists"}