惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
Jina AI
Jina AI
G
Google Developers Blog
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
The GitHub Blog
The GitHub Blog
D
Docker
量子位
罗磊的独立博客
腾讯CDC

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(testing): harden script tooling checks · openclaw/ope...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -3,10 +3,12 @@

33

// Uses installed tools when present, otherwise falls back to pinned hooks where

44

// possible, then runs repo-specific workflow guards.

55

import { spawnSync } from "node:child_process";

6-

import { readdirSync } from "node:fs";

6+

import { mkdtempSync, readdirSync, rmSync } from "node:fs";

7+

import { tmpdir } from "node:os";

78

import { join } from "node:path";

89910

const ACTIONLINT_VERSION = "1.7.11";

11+

const PRE_COMMIT_VERSION = "4.2.0";

1012

const WORKFLOW_DIR = ".github/workflows";

11131214

function commandExists(command, args = ["--version"]) {

@@ -25,6 +27,59 @@ function run(command, args) {

2527

}

2628

}

272930+

function runChecked(command, args) {

31+

const result = spawnSync(command, args, { stdio: "inherit" });

32+

if (result.error) {

33+

return {

34+

message: `[check-workflows] failed to run ${command}: ${result.error.message}`,

35+

status: 1,

36+

};

37+

}

38+

if (result.status !== 0) {

39+

return {

40+

message: null,

41+

status: result.status ?? 1,

42+

};

43+

}

44+

return null;

45+

}

46+47+

function runPreCommitFromTempVenv(hook, hookArgs) {

48+

if (!commandExists("python3", ["--version"])) {

49+

return false;

50+

}

51+

const venvDir = mkdtempSync(join(tmpdir(), "openclaw-check-workflows-pre-commit-"));

52+

const python = join(venvDir, process.platform === "win32" ? "Scripts/python.exe" : "bin/python");

53+

let failure;

54+

try {

55+

failure = runChecked("python3", ["-m", "venv", venvDir]);

56+

if (!failure) {

57+

failure = runChecked(python, [

58+

"-m",

59+

"pip",

60+

"install",

61+

"--disable-pip-version-check",

62+

`pre-commit==${PRE_COMMIT_VERSION}`,

63+

]);

64+

}

65+

if (!failure) {

66+

failure = runChecked(python, ["-m", "pre_commit", ...hookArgs]);

67+

}

68+

if (failure) {

69+

return false;

70+

}

71+

return true;

72+

} finally {

73+

rmSync(venvDir, { force: true, recursive: true });

74+

if (failure) {

75+

if (failure.message) {

76+

console.error(failure.message);

77+

}

78+

process.exit(failure.status);

79+

}

80+

}

81+

}

82+2883

function workflowFiles() {

2984

return readdirSync(WORKFLOW_DIR)

3085

.filter((file) => file.endsWith(".yml") || file.endsWith(".yaml"))

@@ -42,9 +97,12 @@ function runPreCommitHook(hook, files) {

4297

run("python3", ["-m", "pre_commit", ...hookArgs]);

4398

return;

4499

}

100+

if (runPreCommitFromTempVenv(hook, hookArgs)) {

101+

return;

102+

}

4510346104

console.error(

47-

`[check-workflows] missing pre-commit runtime for ${hook}: install pre-commit or python3 pre_commit.`,

105+

`[check-workflows] missing pre-commit runtime for ${hook}: install pre-commit or Python venv support for pre-commit ${PRE_COMMIT_VERSION}.`,

48106

);

49107

process.exit(1);

50108

}

@@ -57,7 +115,8 @@ if (commandExists("actionlint")) {

57115

run("go", ["run", `github.com/rhysd/actionlint/cmd/actionlint@v${ACTIONLINT_VERSION}`]);

58116

} else if (

59117

commandExists("pre-commit") ||

60-

commandExists("python3", ["-m", "pre_commit", "--version"])

118+

commandExists("python3", ["-m", "pre_commit", "--version"]) ||

119+

commandExists("python3", ["--version"])

61120

) {

62121

runPreCommitHook("actionlint", workflows);

63122

} else {