fix(cd): 校验候选部署入口并隔离凭据
build / build (push) Successful in 1m30s

This commit is contained in:
姚章浩
2026-11-23 13:28:40 +08:00
parent 1beaa31771
commit 0246db357f
4 changed files with 23 additions and 14 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ PATH = Path.home() / '.local/state/kg-hifox-release'
RUN_ID = re.compile('[1-9][0-9]{0,14}')
def forge(method, path, payload=None):
def forge(method, path, payload=None, *, raw=False):
request = Request(cd.FORGE + path, method=method,
data=json.dumps(payload).encode() if payload is not None else None)
env = {**os.environ, 'GIT_TERMINAL_PROMPT': '0', 'GIT_ASKPASS': '/bin/false'}
@@ -31,7 +31,7 @@ def forge(method, path, payload=None):
request.add_header('Authorization', 'Basic ' + auth)
request.add_header('Content-Type', 'application/json')
with build_opener(ProxyHandler({}), cd.NoRedirect()).open(request, timeout=20) as response:
return json.load(response)
return response.read(2**20 + 1) if raw else json.load(response)
def hifox(cli, *args):