This commit is contained in:
2025-03-30 04:50:49 +03:00
parent 161edec9a3
commit 57fb66275a

View File

@@ -11,27 +11,29 @@ INPUT_TOKEN = os.getenv('INPUT_TOKEN')
GITHUB_SERVER_URL = os.getenv('GITHUB_SERVER_URL')
GITHUB_REPOSITORY = os.getenv('GITHUB_REPOSITORY')
def escape(text):
return '"' + text + '"'
sample_string = "x-access-token:" + ACTIONS_RUNTIME_TOKEN
sample_string = "x-access-token:" + INPUT_TOKEN
sample_string = "x-access-token:" + ACTIONS_RUNTIME_TOKEN
sample_string_bytes = sample_string.encode("utf-8")
base64_bytes = base64.b64encode(sample_string_bytes)
base64_string = 'AUTHORIZATION: basic ' + base64_bytes.decode("utf-8")
key = 'http.'+GITHUB_SERVER_URL+'/.extraheader'
value = '"'+base64_string+'"'
cmd = 'git config --global ' + key + ' ' + value
value = base64_string
cmd = 'git config --global ' + escape(key) + ' ' + escape(value)
result = os.popen(cmd)
key = 'url.'+GITHUB_SERVER_URL+'/.insteadOf'
cmd = 'git config --global "' + key + '" "' + GITHUB_SERVER_URL + '"'
cmd = 'git config --global "' + key + ' ' + GITHUB_SERVER_URL
key = 'url.'+GITHUB_SERVER_URL+'/.insteadOf'
key = 'url.https://'+INPUT_TOKEN+':x-oauth-basic@codex.r10x.net'+'/.insteadOf'
key = 'url.https://'+ACTIONS_RUNTIME_TOKEN+':x-oauth-basic@codex.r10x.net'+'/.insteadOf'
value = 'git@"'+base64_string+'"'
cmd = 'git config --global "' + key + '" "' + GITHUB_SERVER_URL + '"'
cmd = 'git config --global ' + escape(key) + ' ' + escape(GITHUB_SERVER_URL)
result = os.popen(cmd)
# cmd = 'git config list --local'
@@ -39,10 +41,10 @@ result = os.popen(cmd)
# result = os.popen(cmd)
# print(result.read())
cmd = 'git config list --global'
print(cmd)
result = os.popen(cmd)
print(result.read())
# cmd = 'git config list --global'
# print(cmd)
# result = os.popen(cmd)
# print(result.read())
cmd = 'git clone ' + \
GITHUB_SERVER_URL + '/' + \