Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Delete GitHub Actions Secrets from Repositories

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

import getpass
import requests
token = getpass.getpass()
resp = requests.get(
    url="https://api.github.com/orgs/legendu-net/repos?per_page=100",
    headers={
        "Accept": "application/vnd.github.v3+json",
        "Authorization": f"token {token}",
    },
)
resp
<Response [200]>
for repo in resp.json():
    repo = repo["name"]
    requests.delete(
        url=f"https://api.github.com/repos/legendu-net/{repo}/actions/secrets/GITHUBACTIONS",
        headers={"Authorization": f"token {token}"},
    )