lsh-framework 3.5.0 → 3.5.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.
@@ -102,6 +102,22 @@ async function fetchLatestVersion() {
102
102
  });
103
103
  });
104
104
  }
105
+ /**
106
+ * Decide build status from the build workflow's runs (pure, unit-testable).
107
+ *
108
+ * Only a real `failure` on the most recent COMPLETED run blocks an update.
109
+ * `cancelled` / `skipped` / `null` are infra noise — the build is frequently
110
+ * cancelled by concurrency on the self-hosted runner — and must NOT be reported
111
+ * as a failing build. No completed runs → treat as passing (don't block).
112
+ */
113
+ export function evaluateBuildRuns(runs) {
114
+ const completed = (runs || []).filter((run) => run.status === 'completed');
115
+ if (completed.length === 0) {
116
+ return { passing: true };
117
+ }
118
+ const latest = completed[0];
119
+ return { passing: latest.conclusion !== 'failure', url: latest.html_url };
120
+ }
105
121
  /**
106
122
  * Check GitHub Actions CI status for a specific version tag
107
123
  */
@@ -110,7 +126,9 @@ async function checkCIStatus(_version) {
110
126
  const options = {
111
127
  hostname: 'api.github.com',
112
128
  port: 443,
113
- path: `/repos/gwicho38/lsh/actions/runs?per_page=5`,
129
+ // Scope to the BUILD workflow only. Querying all workflows let a flaky
130
+ // security scan (e.g. Codacy timing out on a download) read as "build failing".
131
+ path: `/repos/gwicho38/lsh/actions/workflows/node.js.yml/runs?branch=main&per_page=5`,
114
132
  method: 'GET',
115
133
  headers: {
116
134
  'User-Agent': 'lsh-cli',
@@ -126,21 +144,9 @@ async function checkCIStatus(_version) {
126
144
  try {
127
145
  if (res.statusCode === 200) {
128
146
  const ghData = JSON.parse(data);
129
- const runs = ghData.workflow_runs || [];
130
- // Find the most recent workflow run for main branch
131
- const mainRuns = runs.filter((run) => run.head_branch === 'main' && run.status === 'completed');
132
- if (mainRuns.length > 0) {
133
- const latestRun = mainRuns[0];
134
- const passing = latestRun.conclusion === 'success';
135
- resolve({
136
- passing,
137
- url: latestRun.html_url,
138
- });
139
- }
140
- else {
141
- // No completed runs found, assume passing
142
- resolve({ passing: true });
143
- }
147
+ const runs = (ghData.workflow_runs || []);
148
+ // The path is already scoped to node.js.yml on main; decide via the pure helper.
149
+ resolve(evaluateBuildRuns(runs));
144
150
  }
145
151
  else {
146
152
  // If we can't check CI, don't block the update
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lsh-framework",
3
- "version": "3.5.0",
3
+ "version": "3.5.1",
4
4
  "description": "Simple, cross-platform encrypted secrets manager with automatic sync, IPFS audit logs, and multi-environment support. Just run lsh sync and start managing your secrets.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {