Skip to content

Commit 290ed79

Browse files
committed
feat(repair): expose Telegram QA leases to OpenClaw
1 parent d56daf0 commit 290ed79

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎.github/workflows/repair-cluster-worker.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ jobs:
663663
GH_TOKEN: ${{ steps.target_write_token.outputs.token }}
664664
CLAWSWEEPER_ALLOWED_OWNER: ${{ steps.target.outputs.target_owner }}
665665
CLAWSWEEPER_AUTOMERGE_SESSION_ID: ${{ inputs.automerge_session_id }}
666+
OPENCLAW_QA_CONVEX_SITE_URL: ${{ steps.target.outputs.target_slug == 'openclaw-openclaw' && secrets.OPENCLAW_QA_CONVEX_SITE_URL || '' }}
667+
OPENCLAW_QA_CONVEX_SECRET_CI: ${{ steps.target.outputs.target_slug == 'openclaw-openclaw' && secrets.OPENCLAW_QA_CONVEX_SECRET_CI || '' }}
666668
run: pnpm run repair:execute-fix -- "$CLUSTER_JOB_PATH" --latest --defer-publication
667669

668670
- name: Renew target write token for post-flight

‎test/repair/cluster-workflow-security.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,30 @@ test("repair workflow applies the fail-closed merge gate before worker execution
314314
);
315315
});
316316

317+
test("Telegram proof credentials reach only the OpenClaw execution worker", () => {
318+
const workflow = parse(
319+
fs.readFileSync(".github/workflows/repair-cluster-worker.yml", "utf8"),
320+
) as Workflow;
321+
const executeFix = workflow.jobs?.execute?.steps?.find(
322+
(step) => step.name === "Execute credited fix artifact",
323+
);
324+
assert.equal(
325+
executeFix?.env?.OPENCLAW_QA_CONVEX_SITE_URL,
326+
"${{ steps.target.outputs.target_slug == 'openclaw-openclaw' && secrets.OPENCLAW_QA_CONVEX_SITE_URL || '' }}",
327+
);
328+
assert.equal(
329+
executeFix?.env?.OPENCLAW_QA_CONVEX_SECRET_CI,
330+
"${{ steps.target.outputs.target_slug == 'openclaw-openclaw' && secrets.OPENCLAW_QA_CONVEX_SECRET_CI || '' }}",
331+
);
332+
for (const [jobName, job] of Object.entries(workflow.jobs ?? {})) {
333+
for (const step of job.steps ?? []) {
334+
if (jobName === "execute" && step === executeFix) continue;
335+
assert.equal(step.env?.OPENCLAW_QA_CONVEX_SITE_URL, undefined);
336+
assert.equal(step.env?.OPENCLAW_QA_CONVEX_SECRET_CI, undefined);
337+
}
338+
}
339+
});
340+
317341
test("missing PR repair jobs preserve only live authorized automerge", () => {
318342
const temporary = fs.mkdtempSync(path.join(tmpdir(), "clawsweeper-restore-mode-"));
319343
const relativeJobPath = "jobs/openclaw/inbox/automerge-openclaw-openclaw-123.md";

‎test/repair/process-env.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ test("codexSubprocessEnv forces ClawSweeper git identity and strips tokens", ()
3333
CLAWSWEEPER_CRABFLEET_SERVICE_TOKEN: "service-secret",
3434
CLAWSWEEPER_CRABFLEET_RUNNER_PTY_URL: "wss://example.invalid/secret",
3535
CLAWSWEEPER_CRABFLEET_WORK_STATE_URL: "https://example.invalid/secret",
36+
OPENCLAW_QA_CONVEX_SITE_URL: "https://qa.example.invalid",
37+
OPENCLAW_QA_CONVEX_SECRET_CI: "qa-ci-secret",
3638
PNPM_CONFIG_IGNORE_SCRIPTS: "false",
3739
PNPM_CONFIG_IGNORE_PNPMFILE: "false",
3840
npm_config_ignore_scripts: "false",
@@ -57,6 +59,8 @@ test("codexSubprocessEnv forces ClawSweeper git identity and strips tokens", ()
5759
assert.equal(env.CLAWSWEEPER_CRABFLEET_SERVICE_TOKEN, undefined);
5860
assert.equal(env.CLAWSWEEPER_CRABFLEET_RUNNER_PTY_URL, undefined);
5961
assert.equal(env.CLAWSWEEPER_CRABFLEET_WORK_STATE_URL, undefined);
62+
assert.equal(env.OPENCLAW_QA_CONVEX_SITE_URL, "https://qa.example.invalid");
63+
assert.equal(env.OPENCLAW_QA_CONVEX_SECRET_CI, "qa-ci-secret");
6064
assert.equal(env.PNPM_CONFIG_IGNORE_SCRIPTS, "true");
6165
assert.equal(env.PNPM_CONFIG_IGNORE_PNPMFILE, "true");
6266
assert.equal(env.npm_config_ignore_scripts, "true");

0 commit comments

Comments
 (0)