Update token call

This commit is contained in:
Aurelien Vaillant
2022-03-29 17:47:46 +02:00
parent 94e2505ba5
commit 06332996fc
+6 -2
View File
@@ -7,8 +7,12 @@ from github import Github
def read_token(): def read_token():
token_file = Path(os.getcwd(), 'tests', 'token.txt') token_file = Path(os.getcwd(), 'tests', 'token.txt')
with open(token_file, 'r') as f: if token_file.exists():
token = f.read() with open(token_file, 'r') as f:
token = f.read()
else:
token = os.environ.get('token')
return token return token