fixed # 修复工作流BUG

This commit is contained in:
2026-10-20 11:06:31 +08:00
parent 6227fd4979
commit 2b0fca8828
2 changed files with 36 additions and 17 deletions
+7 -6
View File
@@ -59,12 +59,13 @@ def publish(package, confirmed=False, request=None):
parent = ref["object"]["sha"] if ref else None
if parent:
owned = call("GET", f"contents/FARM-MANIFEST.json?ref={BRANCH}", None)
if not owned or owned.get("encoding") != "base64":
raise ValueError("Existing preview branch is not generated by Farm")
previous = json.loads(base64.b64decode(owned["content"]))
if (previous.get("target") != "zhenxun"
or previous.get("plugin") != manifest["plugin"]):
raise ValueError("Existing preview branch ownership differs")
if owned is not None:
if owned.get("encoding") != "base64":
raise ValueError("Existing Farm manifest encoding is invalid")
previous = json.loads(base64.b64decode(owned["content"]))
if (previous.get("target") != "zhenxun"
or previous.get("plugin") != manifest["plugin"]):
raise ValueError("Existing preview branch ownership differs")
tree = []
for name, content in sorted(files.items()):
blob = call("POST", "git/blobs", {