Last active
March 4, 2019 16:46
-
-
Save charlesreid1/5394ab4d0bee3b0e9f129df2c954ba21 to your computer and use it in GitHub Desktop.
Centillion Dead Person Switch: If this script is run for more than 72 hours continuously, it will make the dcppc/centillion repository public.
This file contains 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 python | |
import re, os | |
from github import Github | |
import time | |
''' | |
Centillion Dead Person Switch | |
If this script is run for | |
more than 72 hours continuously, | |
it will make the dcppc/centillion | |
repository public. | |
''' | |
def wait(): | |
time.sleep(3600*72) | |
def main(): | |
reponame = 'dcppc/centillion' | |
which_org, which_repo = re.split('/',reponame) | |
access_token = os.environ['GITHUB_TOKEN'] | |
g = Github(access_token) | |
org = g.get_organization(which_org) | |
repo = org.get_repo(which_repo) | |
repo.edit(private=False) | |
if __name__=="__main__": | |
wait() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment