add # 新增经验获取方式

This commit is contained in:
2026-10-20 14:13:31 +08:00
parent 38f4b84cf0
commit 0d3b5f41e0
11 changed files with 146 additions and 16 deletions
+9 -2
View File
@@ -30,9 +30,16 @@ def main():
if inputs["publish"]["default"] != "false":
raise ValueError("Publish must be opt-in")
sync = source["jobs"]["sync-preview"]
expected_condition = (
"(github.event_name == 'push' || "
"(github.event_name == 'workflow_dispatch' && inputs.publish)) && "
"github.ref == 'refs/heads/main' && "
"github.repository == 'Shu-Ying/main_plugin_farm'"
)
if (sync["environment"] != "zhenxun-preview"
or "refs/heads/main" not in sync["if"]
or "workflow_dispatch" not in sync["if"]
or " ".join(sync["if"].split()) != expected_condition
or trigger["push"]["branches"] != ["main"]
or source["jobs"]["build"]["needs"] != "test"
or sync["needs"] != ["test", "build"]):
raise ValueError("Publish boundary differs")
if generated["permissions"] != {"contents":"read"}: