An interactive script to clean up GitHub environments
Github does not have a way to delete environments from their UI so this script does it for you via their API. It can delete specific environments or all of your deployments interactively!
All you need to do is provide the repository name, the respository's owner, and an access token when prompted. You can get the access token by following these instructions. Make sure you give it repo_deployment
permissions.
Note: The owner name will be a GitHub username if it is a personal repository and the organization name if the repository lives under an organization.
git clone https://github.com/VishalRamesh50/Github-Environment-Cleaner.git
cd Github-Environment-Cleaner
pip3 install -r requirements.txt
python3 delete_environment.py
If you would prefer not to be prompted for an owner, repo name, or access token follow these steps
Copy the .env
template to an actual .env
file
cp .env.example .env
Enter whatever values you want inside this file to not be prompted for like this
OWNER=
REPO=
TOKEN=your-github-token