A script to clear environment (deployment) data on a Github repo.
Note: it'll remove ALL of your deployments on a repository.
So you want to clean up this Deployment section because you've removed the integration (heroku, or any others) but it's still listed on the github like this:
We can easily clean it up with this script.
Usage:
npm install
node . YOUR-PERSONAL-ACCESS-TOKEN your-name/repo-name
The Personal Access Token MUST BE repo_deployment
authorized
The output:
30 deployments found
30 deployments marked as "inactive"
30 deployments deleted
Removed Deployments: 30
Full credits to spersico for his answer on Stack Overflow.