Skip to content

ci(vercel): prune stale Preview deployments after PR closure #627

Description

@qnbs

Problem

The existing .github/workflows/prune-deployments.yml prunes GitHub Deployment records, but it does not remove the corresponding Vercel Preview deployment artifacts. A bounded live housekeeping pass confirmed that stale previews can accumulate after merged or closed pull requests.

Required policy

  • never delete Production deployments or Production/Main aliases;
  • retain the newest three Preview deployments for each open PR, including its active branch alias;
  • after a PR is merged/closed, remove its Preview deployments after a bounded grace period when no active alias or review evidence requires them;
  • remove stale failed/canceled previews only after confirming they are detached from active work;
  • classify unknown metadata conservatively and never delete it blindly;
  • perform a dry-run manifest, rate-limited authenticated API deletion, and post-cleanup verification;
  • redact creator emails and tokens from logs/reports.

Scope

Design the smallest authenticated Vercel API/CLI housekeeping integration or documented operator workflow. Preserve Production, domains, project settings, environment variables, rollback history, and active review previews. Do not change deployment creation or promotion semantics.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions