> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# `cleanup-deployment`

When set to `true`, this deletes the Vercel [Deployment](https://vercel.com/docs/glossary#deployment) associated with a deleted GitHub branch. The default is **false**.

::: warning
This option is effective for workflows triggered by the `delete` event. It does not work for events other than `delete`, even when this option is true.
:::

## Usage example

```yaml {18} file="/snippets/cleanup-workflow.yml"
name: Cleanup Vercel deployments

on:
  delete:

jobs:
  cleanup:
    if: ${{ github.event.ref_type == 'branch' }}
    name: Cleanup deployments
    runs-on: ubuntu-latest

    steps:
      - uses: nexterias/actions-vercel@v2
        with:
          token: ${{ secrets.VERCEL_TOKEN }}
          org-id: ${{ secrets.VERCEL_ORG_ID }}
          project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          cleanup-deployment: true

```
