Skip to content

Commit 3975bbd

Browse files
authored
Merge pull request #204 from avinxshKD/fix-hardcoded-token
Move bot token to env variable
2 parents c80168d + 8a43659 commit 3975bbd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

contribute.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import os,sys,platform,base64,time
44

55
# Intializing the Variables
6-
# Hashed token
7-
BOT_TOKEN = "Z2l0aHViX3BhdF8xMUFYS0pGVFkwU2VhNW9ORjRyN0E5X053WDAwTVBUUU5RVUNTa2lNNlFYZHJET1lZa3B4cTIxS091YVhkeVhUYmRQMzdVUkZaRWpFMjlRRXM5"
6+
BOT_TOKEN = os.environ.get('CONCORE_BOT_TOKEN', '')
87
BOT_ACCOUNT = 'concore-bot' #bot account name
98
REPO_NAME = 'concore-studies' #study repo name
109
UPSTREAM_ACCOUNT = 'ControlCore-Project' #upstream account name
@@ -113,7 +112,7 @@ def decode_token(encoded_token):
113112
PR_BODY = f"Study Name: {STUDY_NAME}\nAuthor Name: {AUTHOR_NAME}" if PR_BODY == "#" else PR_BODY
114113
DIR_PATH = STUDY_NAME
115114
DIR_PATH = DIR_PATH.replace(" ","_")
116-
g = Github(decode_token(BOT_TOKEN))
115+
g = Github(BOT_TOKEN)
117116
repo = g.get_user(BOT_ACCOUNT).get_repo(REPO_NAME)
118117
upstream_repo = g.get_repo(f'{UPSTREAM_ACCOUNT}/{REPO_NAME}') #controlcore-Project/concore-studies
119118
base_ref = upstream_repo.get_branch(repo.default_branch)

0 commit comments

Comments
 (0)