@mayijuntuan/cnb-chat 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,7 +92,13 @@ const text = (e) => String((e && e.message) || e).slice(0, 300);
92
92
  sh('git', ['config', 'user.name', 'CodeBuddy']);
93
93
  sh('git', ['add', '-A']);
94
94
  try { sh('git', ['commit', '-m', 'AI: ' + String(lastUser.content).slice(0, 80)]); } catch (e) { /* 无变更 */ }
95
- sh('git', ['push', 'https://' + process.env.CNB_TOKEN + '@cnb.cool/' + process.env.CNB_REPO_SLUG + '.git', 'HEAD:' + BRANCH]);
95
+ try {
96
+ // 优先用容器内已配置凭据的 origin(Prepare 阶段克隆时注入)
97
+ sh('git', ['push', 'origin', 'HEAD:' + BRANCH]);
98
+ } catch (e) {
99
+ // 兜底:显式 token URL
100
+ sh('git', ['push', 'https://' + process.env.CNB_TOKEN + '@cnb.cool/' + process.env.CNB_REPO_SLUG + '.git', 'HEAD:' + BRANCH]);
101
+ }
96
102
  await post({ type: 'progress', content: '✅ 代码已推送到 ' + BRANCH + ' 分支' });
97
103
  } catch (e) {
98
104
  await post({ type: 'progress', content: '⚠️ git push 失败: ' + text(e) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mayijuntuan/cnb-chat",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "CNB pipeline for AI chat streaming relay and CodeBuddy code editing",
5
5
  "type": "module",
6
6
  "bin": {