fixed # 修复工作流BUG

This commit is contained in:
2026-10-20 10:55:24 +08:00
parent 2761be6c3f
commit 6227fd4979
9 changed files with 60 additions and 33 deletions
+3 -1
View File
@@ -25,6 +25,8 @@ def main():
if set(trigger) != {"push", "pull_request", "workflow_dispatch"}:
raise ValueError("Unsafe or missing workflow trigger")
inputs = trigger["workflow_dispatch"]["inputs"]
if set(inputs) != {"publish"}:
raise ValueError("Version must come from the root version.txt file")
if inputs["publish"]["default"] != "false":
raise ValueError("Publish must be opt-in")
sync = source["jobs"]["sync-preview"]
@@ -35,7 +37,7 @@ def main():
raise ValueError("Publish boundary differs")
if generated["permissions"] != {"contents":"read"}:
raise ValueError("Generated workflow permissions differ")
if generated["on"]["push"]["branches"] != ["farm-preview"]:
if generated["on"]["push"]["branches"] != ["main"]:
raise ValueError("Generated branch differs")
print("Workflow YAML and publication guards checked")