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

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - Franky
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
月光博客
月光博客
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
Last Week in AI
Last Week in AI
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
J
Java Code Geeks
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志

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
ci: harden pnpm setup node selection · openclaw/openclaw@...
steipete · 2026-05-20 · via Recent Commits to openclaw:main

@@ -5,6 +5,10 @@ inputs:

55

description: pnpm version to activate via corepack.

66

required: false

77

default: "11.0.8"

8+

node-version:

9+

description: Expected Node.js version already installed by actions/setup-node.

10+

required: false

11+

default: "24.x"

812

cache-key-suffix:

913

description: Suffix appended to the cache key.

1014

required: false

@@ -41,32 +45,82 @@ runs:

4145

env:

4246

COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"

4347

PNPM_VERSION: ${{ inputs.pnpm-version }}

48+

REQUESTED_NODE_VERSION: ${{ inputs.node-version }}

4449

run: |

4550

set -euo pipefail

4651

if [[ ! "$PNPM_VERSION" =~ ^[0-9]+(\.[0-9]+){1,2}([.-][0-9A-Za-z.-]+)?$ ]]; then

4752

echo "::error::Invalid pnpm-version input: '$PNPM_VERSION'"

4853

exit 2

4954

fi

50-

if [[ -n "${RUNNER_TOOL_CACHE:-}" && -n "${NODE_VERSION:-}" ]]; then

51-

requested_node="${NODE_VERSION#v}"

52-

node_tool_root="${RUNNER_TOOL_CACHE}/node"

53-

node_bin=""

54-

if [[ "$requested_node" == *x ]]; then

55-

requested_major="${requested_node%%.*}"

56-

node_bin="$(

57-

find "$node_tool_root" -path "*/bin/node" -type f 2>/dev/null |

58-

awk -F/ -v major="$requested_major" '$(NF-2) ~ ("^" major "\\.") { print }' |

59-

sort -r |

60-

head -n 1

61-

)"

62-

elif [[ -d "${node_tool_root}/${requested_node}" ]]; then

63-

node_bin="$(find "${node_tool_root}/${requested_node}" -path "*/bin/node" -type f 2>/dev/null | head -n 1)"

55+56+

requested_node="${REQUESTED_NODE_VERSION:-${NODE_VERSION:-}}"

57+

requested_node="${requested_node#v}"

58+59+

node_version_matches() {

60+

local actual="$1"

61+

local requested="$2"

62+

if [[ -z "$requested" ]]; then

63+

return 0

6464

fi

65+

case "$requested" in

66+

*x)

67+

[[ "${actual%%.*}" == "${requested%%.*}" ]]

68+

;;

69+

*.*.*)

70+

[[ "$actual" == "$requested" ]]

71+

;;

72+

*.*)

73+

[[ "$actual" == "$requested".* ]]

74+

;;

75+

*)

76+

[[ "${actual%%.*}" == "$requested" ]]

77+

;;

78+

esac

79+

}

80+81+

active_node_version="$(node -p 'process.versions.node' 2>/dev/null || true)"

82+

if ! node_version_matches "$active_node_version" "$requested_node"; then

83+

node_roots=()

84+

for root in \

85+

"${RUNNER_TOOL_CACHE:-}" \

86+

"${AGENT_TOOLSDIRECTORY:-}" \

87+

"${ACTIONS_RUNNER_TOOL_CACHE:-}" \

88+

"/opt/hostedtoolcache" \

89+

"/home/runner/_work/_tool" \

90+

"/Users/runner/hostedtoolcache" \

91+

"/c/hostedtoolcache/windows"

92+

do

93+

if [[ -d "$root/node" ]]; then

94+

node_roots+=("$root/node")

95+

elif [[ "$(basename "$root")" == "node" && -d "$root" ]]; then

96+

node_roots+=("$root")

97+

fi

98+

done

99+100+

node_bin=""

101+

for node_root in "${node_roots[@]}"; do

102+

while IFS= read -r candidate; do

103+

candidate_version="$("$candidate" -p 'process.versions.node' 2>/dev/null || true)"

104+

if node_version_matches "$candidate_version" "$requested_node"; then

105+

node_bin="$candidate"

106+

break 2

107+

fi

108+

done < <(find "$node_root" \( -name node -o -name node.exe \) -type f 2>/dev/null | sort -r)

109+

done

110+65111

if [[ -n "$node_bin" ]]; then

112+

echo "Using Node $("$node_bin" -p 'process.versions.node') from $node_bin"

66113

export PATH="$(dirname "$node_bin"):$PATH"

67114

hash -r

68115

fi

69116

fi

117+118+

active_node_version="$(node -p 'process.versions.node' 2>/dev/null || true)"

119+

if ! node_version_matches "$active_node_version" "$requested_node"; then

120+

echo "::error::Expected Node '${requested_node}', but active node is '${active_node_version:-missing}' at $(command -v node || true)"

121+

exit 1

122+

fi

123+70124

node -v

71125

command -v node

72126

command -v corepack