|
4 | 4 |
|
5 | 5 | # Intializing the Variables |
6 | 6 | # Hashed token |
7 | | -BOT_TOKEN = 'Z2l0aHViX3BhdF8xMUFYM1pBT1kwR0lTTm5jWFlObXdhX3hQa2xyOVdSZ0ZMRURGcERFNFBzbW9zZFFUTzZaNTBBZkcwY2dYSVNKZ2FCSUtNWUo3SGpXTnlxTFda' |
8 | | -REPO_NAME = 'concore' #repo-name |
9 | | -OWNER_NAME = 'parteekcoder' #bot |
| 7 | +BOT_TOKEN = 'Z2l0aHViX3BhdF8xMUFYS0pGVFkwUWVWZ3AzbkpkWk8yX3BOc1VncDFIVDMwZVNXcHhBNm9acHhMaGZGdU5CdE85TGpqdXF1UWRRNzI2S01aUk5HRUNGanFWNDZi' |
| 8 | +REPO_NAME = 'concore' #repo name |
| 9 | +OWNER_NAME = 'parteekcoder123' #bot account name |
10 | 10 | STUDY_NAME = sys.argv[1] |
11 | 11 | STUDY_NAME_PATH = sys.argv[2] |
12 | 12 | AUTHOR_NAME = sys.argv[3] |
13 | 13 | BRANCH_NAME = sys.argv[4] |
14 | 14 | PR_TITLE = sys.argv[5] |
15 | 15 | PR_BODY = sys.argv[6] |
16 | | - |
17 | | -# if author name has spaces |
18 | | -DIR_PATH = AUTHOR_NAME + '_' + STUDY_NAME |
19 | | -UPSTREAM_OWNER = 'parteekcoder123' |
| 16 | +UPSTREAM_OWNER = 'parteekcoder' # upstream to which examples should be contributed |
20 | 17 |
|
21 | 18 |
|
22 | 19 | # Defining Functions |
@@ -80,7 +77,7 @@ def fetchUpstream(repo,base_sha,branch): |
80 | 77 | def runWorkflow(repo,upstream_repo): |
81 | 78 | openPR = anyOpenPR(upstream_repo) |
82 | 79 | if openPR==None: |
83 | | - workflow_runned = repo.get_workflow(id_or_name="pull_request.yml").create_dispatch(ref=BRANCH_NAME,inputs={'title':PR_TITLE,'body':PR_BODY}) |
| 80 | + workflow_runned = repo.get_workflow(id_or_name="pull_request.yml").create_dispatch(ref=BRANCH_NAME,inputs={'title':PR_TITLE,'body':PR_BODY,'upstreamRepo':upstream_repo,'botRepo':OWNER_NAME,'repo':REPO_NAME}) |
84 | 81 | if not workflow_runned: |
85 | 82 | print("Some Error Occured.Please try after some time") |
86 | 83 | exit(0) |
@@ -133,6 +130,8 @@ def decode_token(encoded_token): |
133 | 130 | PR_TITLE="Contributing Study "+AUTHOR_NAME+" "+STUDY_NAME |
134 | 131 | if PR_BODY=="#": |
135 | 132 | PR_BODY="Study Contributed by "+ AUTHOR_NAME |
| 133 | + AUTHOR_NAME = AUTHOR_NAME.replace(" ","_") |
| 134 | + DIR_PATH = AUTHOR_NAME + '_' + STUDY_NAME |
136 | 135 | g = Github(decode_token(BOT_TOKEN)) |
137 | 136 | repo = g.get_user(OWNER_NAME).get_repo(REPO_NAME) |
138 | 137 | upstream_repo = g.get_repo(f'{UPSTREAM_OWNER}/{REPO_NAME}') #controlcore-Project/concore |
|
0 commit comments