Skip to content

Commit c667fd5

Browse files
authored
fix(hermes-plugin): add telemetry credentials generation to CI publish (#1479)
## Summary - Add `scripts/generate-telemetry-credentials.cjs` to `apps/memos-local-plugin/` (same script that openclaw already uses) - Add the "Generate telemetry credentials" step to `hermes-plugin-publish.yml`, injecting `MEMOS_ARMS_*` secrets so published npm packages ship with a working `telemetry.credentials.json` Without this fix, hermes plugin builds have no credentials file and ARMS telemetry is silently disabled. Both plugins now write to the same ARMS app, differentiated by the `platform` tag (`"hermes"` vs `"openclaw"`). ## Test plan - [ ] Verify `hermes-plugin-publish.yml` workflow runs successfully with the new step - [ ] Confirm published hermes npm package contains `telemetry.credentials.json` - [ ] Validate telemetry events from hermes have `platform: "hermes"` in ARMS console
2 parents 1272511 + 18cc382 commit c667fd5

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/hermes-plugin-publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ jobs:
9292
- name: Install dependencies (skip native build)
9393
run: npm install --ignore-scripts
9494

95+
- name: Generate telemetry credentials
96+
run: node scripts/generate-telemetry-credentials.cjs
97+
env:
98+
MEMOS_ARMS_ENDPOINT: ${{ secrets.MEMOS_ARMS_ENDPOINT }}
99+
MEMOS_ARMS_PID: ${{ secrets.MEMOS_ARMS_PID }}
100+
MEMOS_ARMS_ENV: ${{ secrets.MEMOS_ARMS_ENV }}
101+
95102
- name: Bump version
96103
run: npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
97104

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Generate telemetry.credentials.json from environment variables.
4+
*
5+
* Called by CI before `npm publish` so the npm package ships with
6+
* working telemetry credentials while the git repo stays clean.
7+
*
8+
* Required env vars:
9+
* MEMOS_ARMS_ENDPOINT — full ARMS RUM endpoint URL
10+
* MEMOS_ARMS_PID — ARMS application PID
11+
* MEMOS_ARMS_ENV — environment tag (default: "prod")
12+
*/
13+
14+
const fs = require("fs");
15+
const path = require("path");
16+
17+
const endpoint = process.env.MEMOS_ARMS_ENDPOINT || "";
18+
const pid = process.env.MEMOS_ARMS_PID || "";
19+
const env = process.env.MEMOS_ARMS_ENV || "prod";
20+
21+
if (!endpoint) {
22+
console.warn(
23+
"[generate-telemetry-credentials] MEMOS_ARMS_ENDPOINT not set — " +
24+
"skipping. Telemetry will be disabled in this build.",
25+
);
26+
process.exit(0);
27+
}
28+
29+
const out = path.resolve(__dirname, "..", "telemetry.credentials.json");
30+
fs.writeFileSync(out, JSON.stringify({ endpoint, pid, env }, null, 2) + "\n", "utf-8");
31+
console.log("[generate-telemetry-credentials] wrote " + out);

0 commit comments

Comments
 (0)