How to mass remove projects from CircleCI

To stop building any single project you can visit the settings page for that repository and click the "Stop Building" button.

To remove many projects at once, it is best to use our API.

We have created this short `bash` script to help achieve this easily.

Step 1.


Save the following as `script.sh`


  TOKEN="x"
ORG="MyOrgName"
URL_SUFFIX="/enable?circle-token="$TOKEN
URL_PREFIX="https://circleci.com/api/v1.1/project/github/"$ORG"/" while IFS='' read -r repo || [[ -n "$repo" ]]; do
sleep 2
curl -X "DELETE" $URL_PREFIX$repo$URL_SUFFIX
done < "$1"

Replace `$TOKEN` with your personal user token and `$ORG`with the organization name.

 

Step 2.

Create a text file with a list of repo names (one per line, no commas) to be removed.


  repo1
repo2
repo3


Step 3.

Run the script as:

./script.sh repos.txt

This will easily mass unfollow and remove all listed projects.

Was this article helpful?
0 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.