Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Last active February 20, 2024 13:49
Show Gist options
  • Save BolajiAyodeji/ceea27d6312750a599f4066ce3ae0c86 to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/ceea27d6312750a599f4066ce3ae0c86 to your computer and use it in GitHub Desktop.
Automatically delete unused deployments and environments on GitHub.
name: Delete Environment
on:
push:
branches: [main, beta, alpha]
jobs:
delete:
runs-on: ubuntu-latest
steps:
- uses: strumwolf/delete-deployment-environment@v2
with:
# ⚠️ The provided token needs permission for admin write:org.
token: ${{ secrets.CLEANUP_TOKEN }}
# specify the environment name here.
environment: staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment