Обновить executor/cli/git.py
All checks were successful
Test Actions / Builder (push) Successful in 7s
All checks were successful
Test Actions / Builder (push) Successful in 7s
This commit is contained in:
@@ -14,6 +14,7 @@ def handle_git(args):
|
|||||||
DEBUG = True
|
DEBUG = True
|
||||||
ACTIONS_RUNTIME_TOKEN = os.getenv('ACTIONS_RUNTIME_TOKEN')
|
ACTIONS_RUNTIME_TOKEN = os.getenv('ACTIONS_RUNTIME_TOKEN')
|
||||||
INPUT_TOKEN = os.getenv('INPUT_TOKEN')
|
INPUT_TOKEN = os.getenv('INPUT_TOKEN')
|
||||||
|
INPUT_REF = os.getenv('INPUT_REF')
|
||||||
INPUT_REPOSITORY = os.getenv('INPUT_REPOSITORY')
|
INPUT_REPOSITORY = os.getenv('INPUT_REPOSITORY')
|
||||||
INPUT_PATH = os.getenv('INPUT_PATH')
|
INPUT_PATH = os.getenv('INPUT_PATH')
|
||||||
GITHUB_SERVER_URL = os.getenv('GITHUB_SERVER_URL')
|
GITHUB_SERVER_URL = os.getenv('GITHUB_SERVER_URL')
|
||||||
@@ -22,6 +23,8 @@ def handle_git(args):
|
|||||||
GITHUB_REF_NAME = os.getenv('GITHUB_REF_NAME')
|
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
|
TOKEN = INPUT_TOKEN
|
||||||
|
REPOSITORY = INPUT_REPOSITORY
|
||||||
|
REF = INPUT_REF
|
||||||
|
|
||||||
def escape(text):
|
def escape(text):
|
||||||
return '"' + text + '"'
|
return '"' + text + '"'
|
||||||
@@ -51,7 +54,7 @@ def handle_git(args):
|
|||||||
cmd = 'git config set --local ' + escape(key) + ' ' + escape(GITHUB_SERVER_URL)
|
cmd = 'git config set --local ' + escape(key) + ' ' + escape(GITHUB_SERVER_URL)
|
||||||
exec_cmd(cmd)
|
exec_cmd(cmd)
|
||||||
|
|
||||||
cmd = 'git remote add origin ' + GITHUB_SERVER_URL + INPUT_REPOSITORY
|
cmd = 'git remote add origin ' + GITHUB_SERVER_URL + REPOSITORY
|
||||||
exec_cmd(cmd)
|
exec_cmd(cmd)
|
||||||
|
|
||||||
cmd = 'git fetch --progress --depth 1 origin ' + GITHUB_REF
|
cmd = 'git fetch --progress --depth 1 origin ' + GITHUB_REF
|
||||||
|
|||||||
Reference in New Issue
Block a user