Created
April 19, 2021 01:16
-
-
Save rdkls/6b1d14c4ca52417716c11f3dad05bbaf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from github import Github | |
from pprint import pprint | |
import requests | |
TOKEN = 'PERSONAL_ACCESS_TOKEN' | |
g = Github(TOKEN) | |
for repo in g.get_user().get_repos(visibility='public'): | |
owner_name = repo.owner.login | |
repo_name = repo.name | |
url = f'https://api.github.com/repos/{owner_name}/{repo_name}/actions/permissions' | |
print(url) | |
res = requests.put( | |
url=url, | |
data='{"enabled":false}', | |
headers={ | |
'Authorization': f'token {TOKEN}', | |
'Accept': 'application/vnd.github.v3+json', | |
} | |
) | |
pprint(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment