1. Request a token for deletion permission

Settings / Developer settings / Personal access tokens / Generate new token

  1. Delete the script

Create a new repo.txt file with one repository per line in the format

username/repo1
username/repo2
username/repo3
......
Copy the code

Creating a Deletion Script

# -*- coding: utf-8 -*- ''' @author: longjiang @date: 2021/6/18 9:22 @desc: ''' from time import sleep import requests headers = { "Accept": "application/vnd.github.v3+json", "Authorization": Note: at the same time, # XXXXXX is the signed token "x-oauth-scopes ": "repo" } with open('repo.txt', 'r', encoding='utf-8') as f: data = f.readlines() url = "https://api.github.com/repos/{}/{}" urls = [] for line in data: name, repo = line.strip().split("/") urls.append(url.format(name, repo)) for l in urls: requests.delete(url=l, headers=headers) sleep(2)Copy the code

Just execute the script