Обновить executor/cli/git.py
All checks were successful
Test Actions / Builder (push) Successful in 10s
All checks were successful
Test Actions / Builder (push) Successful in 10s
This commit is contained in:
@@ -20,7 +20,8 @@ def handle_git(args):
|
||||
GITHUB_REPOSITORY = os.getenv('GITHUB_REPOSITORY')
|
||||
GITHUB_REF = os.getenv('GITHUB_REF')
|
||||
GITHUB_REF_NAME = os.getenv('GITHUB_REF_NAME')
|
||||
assert ACTIONS_RUNTIME_TOKEN==INPUT_TOKEN, 'token not equal'
|
||||
# assert ACTIONS_RUNTIME_TOKEN==INPUT_TOKEN, 'token not equal'
|
||||
TOKEN = INPUT_TOKEN
|
||||
|
||||
def escape(text):
|
||||
return '"' + text + '"'
|
||||
@@ -33,8 +34,8 @@ def handle_git(args):
|
||||
cmd = 'git init'
|
||||
exec_cmd(cmd)
|
||||
|
||||
sample_string = "x-access-token:" + ACTIONS_RUNTIME_TOKEN
|
||||
sample_string = "x-access-token:" + INPUT_TOKEN
|
||||
sample_string = "x-access-token:" + TOKEN
|
||||
sample_string = "x-access-token:" + TOKEN
|
||||
sample_string_bytes = sample_string.encode("utf-8")
|
||||
|
||||
base64_bytes = base64.b64encode(sample_string_bytes)
|
||||
@@ -45,7 +46,7 @@ def handle_git(args):
|
||||
cmd = 'git config set --local ' + key + ' ' + escape(value)
|
||||
exec_cmd(cmd)
|
||||
|
||||
key = 'url.https://'+ACTIONS_RUNTIME_TOKEN+':x-oauth-basic@codex.r10x.net'+'/.insteadOf'
|
||||
key = 'url.https://'+TOKEN+':x-oauth-basic@codex.r10x.net'+'/.insteadOf'
|
||||
value = 'git@"'+base64_string+'"'
|
||||
cmd = 'git config set --local ' + escape(key) + ' ' + escape(GITHUB_SERVER_URL)
|
||||
exec_cmd(cmd)
|
||||
|
||||
Reference in New Issue
Block a user